[dev] [dmenu] tip

From: Connor Lane Smith <cls_AT_lubutu.com>
Date: Sun, 15 May 2011 22:46:17 +0100

Hey all,

I've been tinkering with dmenu the last few days. I think it would be
good to get a 4.3 release out at some point soon, so if anyone could
report any bugs to me that would be swell.
A brief list of changes:

In terms of SLOC, tip is about the size of 4.0 and most of the 3.x
series, with a current count of 683 lines of C and 7 of shell script.
(Which is quite small, considering it now has a cursor, vertical
lines, and paste.)

It ought to be a lot faster. The main data structure now uses an
array, and I've optimised incremental search, so the longer you type
the quicker matching will become; and jumping to the last menu item is
now O(1). It only starts to get noticeably sluggish on an Atom netbook
when dealing with half a million items or so.

dmenu_path is a shell script again. Based on my tests it's slightly
slower than the C version, but is still a lot faster than the original
script, so I think that's acceptable -- I don't notice a cache miss,
with a few thousand executables. (Use '-f' or a watcher process and
you're golden.)

For portability, dmenu is now ANSI C90, which more compilers support
than C99, and dmenu_path is POSIX compliant, whereas the old script
wasn't. I also checked the Makefile is POSIX compliant and works with
BSD make. ;)

Any bugs, tell me!

Thanks,
cls
Received on Sun May 15 2011 - 23:46:17 CEST

This archive was generated by hypermail 2.2.0 : Sun May 15 2011 - 23:48:02 CEST