Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] RFC: sorted value_string + bsearch

From: Jakub Zawadzki <darkjames@xxxxxxxxxxxxxxxx>
Date: Thu, 22 Apr 2010 15:40:28 +0200
On Tue, Apr 20, 2010 at 11:43:49PM +0200, Anders Broman wrote:
> Would it be faster to use hash tables instead of very large 
> value_strings? In diameter i think
> 3gpp AVP codes are in a value_string > 2k

I think main problem with hash tables, is that you need to have
big table, and good hash function.

Binary search is O(log2 n), so for 5k we have at most 13 lookups.
To achieve it with hash table we need 384 (5000/13) buckets (HASHPORTSIZE in addr_resolv.c is only 256).

And I think it's hard to implement hash tables, using current value_string ABI.

Cheers.