Wireshark-dev: Re: [Wireshark-dev] Linear search in value_string_ext

From: Bill Meier <wmeier@xxxxxxxxxxx>
Date: Mon, 11 Jun 2012 15:35:47 -0400
On 6/11/2012 3:24 PM, Jakub Zawadzki wrote:
Hi,

Bill recently converted lot of code which were using value_string API to
"newer" value_string_ext API.

But the problem is that not all value_string arrays are sorted for
faster access.

If value_string_ext is used in hfinfo it can be easily found with oneliner:
   $ ./tshark -G values | grep ^E | grep 'Linear Search'

Currently it outputs:
   E       ip.dsfield.dscp 21      dscp_vals       [Linear Search]
   E       rsvp.object     57      rsvp_class_vals [Linear Search]


I was about to do the check...    :)

Looks like I missed two "not ordered" cases; I'll fix them.

I've reorder items once in r42418, but I'm not sure if **primary** efford
is to convert all value_string to _ext variant, and remove "old" API,
or to optimize code. Bill?

I'm just optimizing as I go along ...

Bill