Re: [SLUG] memcmp versus strncmp

2005-12-12 Thread Ken Foskey
Slightly amended code, same basic conditions: memcmp 6.9 user seconds memcmp -ansi 10.2 user seconds Enforcing standards with gcc -ansi is a bad idea it looks like :-( This draws in the gcc builtins and they do not perform as well. Thanks for the info. Ken -- SLUG - Sydney Linux

Re: [SLUG] memcmp versus strncmp

2005-12-12 Thread Ian Wienand
On Mon, Dec 12, 2005 at 07:57:00PM +1100, Ken Foskey wrote: Enforcing standards with gcc -ansi is a bad idea it looks like :-( This draws in the gcc builtins and they do not perform as well. You are buliding with optimisation on right (-03 or similar)? If you want fast memcmp() do it on an

Re: [SLUG] memcmp versus strncmp

2005-12-11 Thread Ian Wienand
On Fri, Dec 09, 2005 at 11:56:14PM +1100, Ken Foskey wrote: This is an unexpected statistic... Subroutine using massive number of matches: strcmp(x,y) 1.87 seconds strncmp(x,y,6) 1.63 seconds memcmp(x,y,6) 5.85 seconds Ignoring the other code it is a huge overhead for using memcmp on

[SLUG] memcmp versus strncmp

2005-12-09 Thread Ken Foskey
This is an unexpected statistic... Subroutine using massive number of matches: strcmp(x,y) 1.87 seconds strncmp(x,y,6) 1.63 seconds memcmp(x,y,6) 5.85 seconds Ignoring the other code it is a huge overhead for using memcmp on Ubuntu I386 as opposed to strncmp. I would not have expected

Re: [SLUG] memcmp versus strncmp

2005-12-09 Thread Benno
On Fri Dec 09, 2005 at 23:56:14 +1100, Ken Foskey wrote: This is an unexpected statistic... Subroutine using massive number of matches: strcmp(x,y) 1.87 seconds strncmp(x,y,6) 1.63 seconds memcmp(x,y,6) 5.85 seconds Ignoring the other code it is a huge overhead for using memcmp on Ubuntu