Proposition: use a hashtable instead of bsearch to locate applets

Denys Vlasenko vda.linux at googlemail.com
Sun Jun 1 22:28:00 UTC 2014


On Friday 30 May 2014 20:19, walter harms wrote:
> Am 30.05.2014 20:07, schrieb Rich Felker:
> > If there is a desire to change the way applet lookup is done, I would
> > suggest trying to make it optimal in both size and performance. 150µs
> > is not impressive at all. A perfect hash constructed at build time for
> > the list of busybox applet-name strings should make it possible to do
> > the applet lookup in ~1µs with trivial code/table size (all constant
> > in .text).
> > 
> 
> We should keep in mind that busybox is also about size reduction, so we need
> a more flexible code that can be used on other places as well (e.g. shell).

Hmm.
awk.c already has hashtable implementation. A growable one at that.


More information about the busybox mailing list