Discussion:
[dmenu] Cache on start option?
Roger
2009-10-21 19:35:26 UTC
Permalink
Is there a cache on start of /bin folders option vs only when we select
the hot key to trigger dmenu?

Reason being, it might be preferred to cache the bin following DWM start
vs, when somebody finally gets to executing dmenu.

ie.

1) Start DWM
2) After start of DWM, execute DMenu -cache (to cache/scan all bin
folders into $HOME/.dmenu).

3) Somebody finally executes DMenu to choose an application immediately
vs. waiting for DMenu to also cache (all bin folders).

VS. Currently,

1) Start DWM
2) Wait for DMenu to be executed by somebody, then somebody has to sit
and wait for DMenu to cache bin folders before choosing their
application.
--
Roger
http://rogerx.freeshell.org
Kris Maglione
2009-10-21 20:00:16 UTC
Permalink
Post by Roger
1) Start DWM
2) After start of DWM, execute DMenu -cache (to cache/scan all bin
folders into $HOME/.dmenu).
3) Somebody finally executes DMenu to choose an application immediately
vs. waiting for DMenu to also cache (all bin folders).
Start dwm from a script.
Post by Roger
VS. Currently,
1) Start DWM
2) Wait for DMenu to be executed by somebody, then somebody has to sit
and wait for DMenu to cache bin folders before choosing their
application.
It takes a few miliseconds.
--
Kris Maglione

Fast, fat computers breed slow, lazy programmers.
--Robert Hummel
Roger
2009-10-21 21:00:25 UTC
Permalink
Post by Kris Maglione
Post by Roger
1) Start DWM
2) After start of DWM, execute DMenu -cache (to cache/scan all bin
folders into $HOME/.dmenu).
3) Somebody finally executes DMenu to choose an application immediately
vs. waiting for DMenu to also cache (all bin folders).
Start dwm from a script.
Already done via .xinitrc.
Post by Kris Maglione
Post by Roger
VS. Currently,
1) Start DWM
2) Wait for DMenu to be executed by somebody, then somebody has to sit
and wait for DMenu to cache bin folders before choosing their
application.
It takes a few miliseconds.
... depending on size of bin folders.

/bin $ du -kh --max-depth=0
7.9M

/sbin $ du -kh --max-depth=0
21M

/usr/bin $ du -kh --max-depth=0
551M

/usr/sbin $ du -kh --max-depth=0
43M

... of course, rm -f /usr/bin/* would speed things up. ;-)
--
Roger
http://rogerx.freeshell.org
frederic
2009-10-21 21:24:03 UTC
Permalink
dmenu can read items from stdin. You may create the cache yourself with
e.g. "ls -1 -colors=never /bin >cache", then do "dmenu <cache" etc. Look
at the dmenu_run script for details.
hiro
2009-10-21 21:50:04 UTC
Permalink
Post by frederic
"ls -1 -colors=never
Hah! (please excuse my Schadenfreude in case this was inappropriate)
Roger
2009-10-21 21:59:56 UTC
Permalink
Post by frederic
dmenu can read items from stdin. You may create the cache yourself with
e.g. "ls -1 -colors=never /bin >cache", then do "dmenu <cache" etc. Look
at the dmenu_run script for details.
Bingo! I'll give it a try when I get a chance. Thanks! ;-)
--
Roger
http://rogerx.freeshell.org
Kris Maglione
2009-10-21 23:35:14 UTC
Permalink
Post by Roger
Post by Kris Maglione
Start dwm from a script.
Already done via .xinitrc.
Then just generate the cache at startup.
Post by Roger
Post by Kris Maglione
It takes a few miliseconds.
... depending on size of bin folders.
The size of the binaries is of absolutely no consequence, only
the number of directory entries.
--
Kris Maglione

A program that produces incorrect results twice as fast is infinitely
slower.
--John Osterhout
Loading...