Wireshark-dev: Re: [Wireshark-dev] Startup speed up - assembler usage

From: "Didier" <dgautheron@xxxxxxxx>
Date: Thu, 22 Nov 2007 07:55:13 +0100
Hi,

On Wed, 21 Nov 2007 09:39:02 +0100, Kukosa, Tomas wrote
> Hi,
> 
> sorry for my delay but I was little bit busy during last days.
> 
> What I have done:
> I have renamed and made few new functions in proto.c for more
> comfortable profiling.
>   g_strcmp() renamed to wrs_strcmp()
>   g_str_hash() from glib coppied into proto.c with new name
> wrs_str_hash()
>   some parts of proto_register_field_init() put into new functions
> wrs_check_charset() and tmp_check_assert()

> 
> See attached results:
>   presultr0.txt - all implemented in C
>   presultr1.txt - wrs_strcmp() and wrs_str_hash() implemented in
> assembler
>  Note: you will not see individual times for wrs_strcmp() and
> wrs_str_hash() in the presultr1.txt as my assembler (NASM) does nut
> support MS debug information but you can compare time of caller
> functions and total time

I'm missing something:

Slow version 15,3 seconds

3214,445  21,0     3214,445  21,0 18849296 _wrs_strcmp (asm_utils.obj)


1582,290  10,3     3159,070  20,6   582984 _g_tree_insert (libglib-2.0-0.dll)

1517,114   9,9     3154,809  20,6   586208 _g_tree_lookup (libglib-2.0-0.dll)
...
446,689   2,9      446,689   2,9    21864 _wrs_str_hash (asm_utils.obj)

Ok, make sense.
Note: _wrs_strcmp + _wrs_str_hash == 3,7 seconds

But
Fast version:
9,1 seconds. 

And
371,999   4,1      372,009   4,1   582984 _g_tree_insert (libglib-2.0-0.dll)


328,447   3,6      328,459   3,6   586208 _g_tree_lookup (libglib-2.0-0.dll)   

Why did  _g_tree_insert speed up from 1582,290 to 371,999?


Didier