[BusyBox] Applet Hashing for Busybox

Tomi Ollila Tomi.Ollila at sonera.com
Sat Oct 21 11:33:12 UTC 2000


Friday Oct 20 17:16:05 -0600 2000 Mark Whitley <markw at lineo.com> wrote:
> Fellow Busyboxers,
> 
> Erik has mentioned to me in the past that the current linear search approach
> to finding applets in busybox.c leaves something to be desired: it's slow and
> it gets slower as we add more applets. He mentioned in passing that it would
> be great if I were to "do something about that". So here I go.

(* stuff deleted *)
> 
> 
> Patch is attached; it is against the latest CVS. Please look it over and give
> comments / suggestions / feedback / frosty bananas / etc.


Your system sounds very good. I have not looked it yet but will soon...

I have also implemented something for the same purpose and since it is good 
to have many choises I'm presenting it here (sorry for not doie it earlyer,
too many emails (and most of them in foreign language) to read through, so
I have not noticed such a desire previously).

I've done a perl script, that generates a main() function which based on
strings matching with argv[0] chooses a function to execute.

The search is done using a binary search, so the requirement for finding
right choise is O(log2)..

My script, and an example output (with one obvious error ;) is attached
below.

> 
> Cheers,
> 
> Mark Whitley

(* Mark's working patch removed *)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: multibinmain.tar.gz
Type: application/octet-stream
Size: 2348 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20001021/63e36bc0/attachment.obj 


More information about the busybox mailing list