Comment # 14
on bug 9367
from Bill Meier
(In reply to comment #12)
> (In reply to comment #11)
> Ok, is there a big benefits when using extended value string vs value string
> ?
Yes !
As a test, I did some performance analysis using 'valgrind / callgrind' for
tshark dissecting a capture file with ~ 7900 frames of which 70% contained the
mq protocol.
Test #1: packet-mq.c, packet-mq-base.c: as is;
Test #2: packet-mq.c, packet-mq-base.c: all value-string array entries '#if 0'd
IOW: all mq value-string lookups fai l
The output of the tests is essentially a list the count of "Instruction Refs"
for the whole program and for each function called in the program.
The results:
Note: try_val_to_str_idx() is the function which actually does the value-string
lookup.
Test #1 (mq dissectors with full [non-empty] value-string arrays)
-------
9,604,863,520 PROGRAM TOTALS
1,513,737,948 epan/value_string.c:try_val_to_str_idx
563,959,429 ???:vfprintf [/usr/lib/libc-2.17.so]
....
Test #2 (mq dissectors with "empty" value-string arrays
-------
8,137,308,796 PROGRAM TOTALS
....
18,653,825 epan/value_string.c:try_val_to_str_idx
....
So: for try_val_to_str_idx() calls:
Test #1: 15 % of total "Instruction Refs" (the highest count)
Test #2: .2% of the total
Overall: The total "Instruction refs" were reduced by 15% when using the mq
dissectors with empty value string arrays.
Since some of the mq value-string arrays are *very* large, I'm not surprised at
the results of the test and I certainly would expect a large improvement once
extended value strings are used for the "larger" value-string arrays. (Accesses
to extended-value-strings are a either direct lookup or a binary search if the
value-string arrays are sorted in ascending order).
>
> Is there a minimum of element to be defined to be more advantageous when
> using extended string ?
>
I haven't done the test so I don't know a good minimum. (I need to run that
test and will do so sometime in the next several days. I've previously tended
to use more or less a size of 20 elements in an array as a minimum but that's
not based upon any tests).
In any case, for now I suggest starting by using extended value strings for all
the larger arrays (e.g., maybe those containing over 50 elements) and we'll see
how much improvement we get.
(Obviously the results are dependent upon how many references to a particular
value-string-array happen for a particular capture file).
packet-mq/packet-mq-base value-string array sizes:
1150 PrmId
833 mqrc
329 selector
190 mqcmd
165 Command
142 MQCFINT_Parse
77 StructID
65 opcode
35 mqat
33 ApplType
33 status
31 objtype
31 ObjType
25 mqcft
24 PrmTyp
24 xaer
20 ChannelSubStates
15 notifcode
12 FilterOP
12 Platform
10 ChannelStatus
...
You are receiving this mail because:
- You are watching all bug changes.