Wireshark-dev: Re: [Wireshark-dev] RFC: sorted value_string + bsearch
From: Kaul <mykaul@xxxxxxxxx>
Date: Mon, 12 Apr 2010 13:20:46 +0300


2010/4/12 Jakub Zawadzki <darkjames@xxxxxxxxxxxxxxxx>
Hi,

In wireshark there are some large value_string arrays.
Some developers keep them sorted, some don't :)

Sort how? In some cases, wouldn't it make more sense to put the more commonly used string near the top and perform a normal search?
I agree it makes sense when there's no knowledge about the distribution of the strings.
Y.


Dissectors in which value_string are sorted could be a little faster
thanks to binary search.

In attachment patch to introduce new 'fast' functions for value_string.

Can this patch be commited? I don't know if I will have time to rewrite dissectors.
Some time later it should be also possible to get rid of (hated) value_string NULL terminator.


I'm also attaching sample dns_types rewrite.

Cheers.

___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
            mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe