List:Internals« Previous MessageNext Message »
From:Eric Day Date:May 9 2009 7:25am
Subject:Re: ptr_compare replace with memcmp and associated performance
View as plain text  
My linux vs sparc testing, completely unequal buffers. One thing
I find really strange is that gcc -O3 memcmp was slower than gcc
without a -O option.

linux= 2.4ghz core2duo, gcc 4.3.2 64bit

linux> gcc -g -Wall -o a a.c

linux> ./a 100000000 8
100000000 repetitions
Testing memcmp ..... done,      3.268 seconds
Testing builtin memcmp ....... done,      3.272 seconds
Testing loop .... done,      6.416 seconds
Testing loop32 .... done,      2.432 seconds
Testing loop64 .... done,      1.792 seconds
Testing no-op .... done,      0.592 seconds

linux> ./a 100000000 256
100000000 repetitions
Testing memcmp ..... done,     10.561 seconds
Testing builtin memcmp ....... done,     10.565 seconds
Testing loop .... done,    174.943 seconds
Testing loop32 .... done,     46.299 seconds
Testing loop64 .... done,     22.569 seconds
Testing no-op .... done,      0.588 seconds

linux> gcc -g -Wall -O3 -o a a.c

linux> ./a 100000000 8
100000000 repetitions
Testing memcmp ..... done,      5.052 seconds
Testing builtin memcmp ....... done,      5.016 seconds
Testing loop .... done,      2.604 seconds
Testing loop32 .... done,      1.088 seconds
Testing loop64 .... done,      0.844 seconds
Testing no-op .... done,      0.588 seconds

linux> ./a 100000000 256
100000000 repetitions
Testing memcmp ..... done,     88.130 seconds
Testing builtin memcmp ....... done,     88.118 seconds
Testing loop .... done,     66.476 seconds
Testing loop32 .... done,     16.669 seconds
Testing loop64 .... done,      8.629 seconds
Testing no-op .... done,      0.584 seconds


sparc= Niagra2 sparcv9 1165 MHz, cc: Sun Ceres C 5.10 SunOS_sparc 2009/03/06

sparc> cc -m64 -o a a.c

sparc> ./a 10000000 8
10000000 repetitions
Testing memcmp ..... done,      2.060 seconds
Testing builtin memcmp ....... done,      2.060 seconds
Testing loop .... done,      4.171 seconds
Testing loop32 .... done,      1.450 seconds
Testing loop64 .... done,      0.987 seconds
Testing no-op .... done,      0.365 seconds

sparc> ./a 10000000 256
10000000 repetitions
Testing memcmp ..... done,      8.024 seconds
Testing builtin memcmp ....... done,      8.023 seconds
Testing loop .... done,    119.094 seconds
Testing loop32 .... done,     30.189 seconds
Testing loop64 .... done,     15.356 seconds
Testing no-op .... done,      0.361 seconds

sparc> cc -m64 -O3 -o a a.c

sparc> ./a 10000000 8
10000000 repetitions
Testing memcmp ..... done,      1.854 seconds
Testing builtin memcmp ....... done,      1.853 seconds
Testing loop .... done,      1.416 seconds
Testing loop32 .... done,      0.652 seconds
Testing loop64 .... done,      0.498 seconds
Testing no-op .... done,      0.189 seconds

sparc> ./a 10000000 256
10000000 repetitions
Testing memcmp ..... done,      7.818 seconds
Testing builtin memcmp ....... done,      7.817 seconds
Testing loop .... done,     35.465 seconds
Testing loop32 .... done,     10.228 seconds
Testing loop64 .... done,      5.020 seconds
Testing no-op .... done,      0.189 seconds


-Eric
Thread
ptr_compare replace with memcmp and associated performanceStewart Smith8 May
  • Re: ptr_compare replace with memcmp and associated performanceEric Day9 May
    • Re: ptr_compare replace with memcmp and associated performanceStewart Smith11 May
  • Re: [Drizzle-discuss] ptr_compare replace with memcmp and associatedperformanceJay Pipes10 May
    • Re: [Drizzle-discuss] ptr_compare replace with memcmp and associatedperformanceRoy Lyseng10 May
  • Re: ptr_compare replace with memcmp and associated performancePeter Benjamin Volk17 May