Request for comments and more performance data

Gawain Bolton gbolton@free.fr
Tue Aug 12 19:48:00 GMT 2003


Hello,

I have not had any comments concerning the last patch posted here:

    http://gcc.gnu.org/ml/libstdc++/2003-08/msg00087.html

I have found that this patch improves the performance scalability of 
std::list quite a bit.  Using the 
libstdc++-v3/testsuite/performance/list_create_fill_sort performance.cc 
test compiled with -O2, here is the performance data before and after 
the patch:

Before:
list_create_fill_sort.cc        Iterations: 10000000  Size:        1     
353r  290u    3s    648mem    3pf
list_create_fill_sort.cc        Iterations:  1000000  Size:       10    
1229r 1014u    6s      0mem    0pf
list_create_fill_sort.cc        Iterations:   100000  Size:      100    
1020r  851u    3s    792mem    0pf
list_create_fill_sort.cc        Iterations:    10000  Size:     1000    
1255r 1006u    2s  14368mem    0pf

After:
list_create_fill_sort.cc        Iterations: 10000000  Size:        1     
376r  304u    5s   648mem    3pf
list_create_fill_sort.cc        Iterations:  1000000  Size:       10     
954r  811u    3s     0mem    0pf
list_create_fill_sort.cc        Iterations:   100000  Size:      100     
691r  572u    0s   792mem    0pf
list_create_fill_sort.cc        Iterations:    10000  Size:     1000     
720r  609u    3s 14368mem    0pf

Note the difference in performance when the list size is 1 versus 1000.  
Before the patch there is a factor of 3.44 and after this falls to 1.98 
when the total CPU time (user and system time) is compared.

I have found that these performance improvements come directly from the 
simpler List_iterator class suggested.  This new iterator class improves 
performance as it does not derive from another class and so has no base 
constructor to call.  Also, the increment/decrement functions are 
inlined, rather than in a parent class.

Cheers,


Gawain




More information about the Libstdc++ mailing list