Wireshark mailing list archives

Re: RFC: sorted value_string + bsearch


From: Kaul <mykaul () gmail com>
Date: Mon, 12 Apr 2010 13:20:46 +0300

2010/4/12 Jakub Zawadzki <darkjames () darkjames ath cx>

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 () wireshark org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
            mailto:wireshark-dev-request () wireshark org?subject=unsubscribe

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

Current thread: