Re: [dev] dmenu_path rewrite in C

From: Anselm R Garbe <>
Date: Wed, 19 May 2010 10:42:34 +0100

Hi Elmo,

On 19 May 2010 09:04, Elmo Todurov <> wrote:
> I rewrote dmenu_path in C. It's an order of magnitude faster than the shell
> script on cache misses and around 2 times faster on cache hits.
> I'm attaching the code to this mail. I'd be glad to see it included in
> dmenu.

thanks for your effort. Though I'm a bit uneasy about it.

First of all we had similar proposals in the past, so others did a
similar thing in C already. However the main reason I'm a bit sceptic
is this: I think the existing shell script based dmenu caching is
already quite fast (assumed the cache exists) and I doubt that your
native tool does make the cache propagation itself faster.

Also I need to convince myself that your cache creation is really that
much faster, simply because the bottleneck I remember a long time ago
was rather how many executables and PATH directories were visited and
overall filesystem performance. I can understand though that visiting,
sorting and uniq'ing them inprocess is surely faster than an
interpreted shell script. The question is though, if it really
justifies a native tool in mainstream dmenu ;)

As a side note: did you test it with following symbolic links etc? I
very darkly remember a bunch of issues with symbolic links if they
aren't dealt with properly.

We also had solutions that used find which was considerable faster
than current plain sh based approach, but for simplicity and clarity
reasons we always reverted to the current solution.

I think adding your tool to the patches section into the wiki for now
is the right thing to do and we can collect more opinions.

Received on Wed May 19 2010 - 09:42:34 UTC

This archive was generated by hypermail 2.2.0 : Wed May 19 2010 - 09:48:02 UTC