[Bug c/43052] New: Inline memcmp is *much* slower than glibc's

2010-02-12 Thread bjorn at haxx dot se
memcmp-intensive code becomes up to 6 times slower if compiled with the -O3
option than with the -g or -O0 option. The reason for this is that the inline
memcmp function is *much* slower than the glibc memcmp.

Here's a simple test case:

#include 
#include 
#include 
#include 

void* list[1024 * 1024];

int main(void)
{
int count = sizeof(list) / sizeof(char*);
int i;
for (i=0; i < count; i++)
list[i] = calloc(1024, 1);

int dupes = 0;
int start = times(NULL);
for (i=0; ihttp://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052



[Bug target/43052] [4.9/5/6 Regression] Inline memcmp is *much* slower than glibc's, no longer expanded inline

2016-01-14 Thread bjorn at haxx dot se
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052

--- Comment #34 from Björn Stenberg  ---
Yes, confirmed. -O3 and -O0 now both run the same speed so this bug is fixed.

Sorry for being potentially several years late confirming this.