apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Malo ...@perlig.de>
Subject Re: [PATCH] locale independent apr_str_eq function
Date Sun, 03 Aug 2003 13:39:12 GMT
* Joe Orton wrote:

> That benchmark is rigged :) It only compares against the strcmp in
> libc.so due to the missing #include <string.h>.  I'd always bet on the
> inline asm over C code...

oh man, I'm dumb ;-)
Thanks.

> $ gcc -O2 -DINLINE -o streq streq.c && ./streq
> iterations: 1000000000
> 
> [01/05] streq: 4 sec
> [02/05] streq: 4 sec
> [03/05] streq: 4 sec
> [04/05] streq: 4 sec
> [05/05] streq: 4 sec
> [average] streq: 4 sec
> [01/05] !strcmp: 2 sec
> [02/05] !strcmp: 3 sec
> [03/05] !strcmp: 3 sec
> [04/05] !strcmp: 3 sec
> [05/05] !strcmp: 2 sec
> [average] !strcmp: 2.6 sec

Well, would it still make sense to define an apr_str(n)eq macro for
consistency?

Hmm, so now we can just rename apr_streq.c to apr_strcaseeq.c (dropping the
simple eq functions), include the case tables only there (regarding to the
other issue). The macros could stay in apr_lib.h (plus the apr_streq
macros?), since one has to link against the apr anyway. The tables should
probably be declared as APR_DECLARE_DATA then.
Does this sound better?

nd

Mime
View raw message