This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Performance problems between gcc 12.2 and 13


On 07/17/2012 04:47 PM, Carlos O'Donell wrote:
On 7/17/2012 4:22 PM, Judd Montgomery wrote:

You've become your own distribution, and as such you must pay careful attention to the compiler and binary utilities you used to compile glibc.

Yes. My hope is to find a patch I can recompile glibc source packages with.

I compiled glibc with the following:
$ env CFLAGS='-O2 -U_FORTIFY_SOURCE -fno-stack-protector' ../../src/$VERSION/configure --enable-omitfp --prefix=/opt/$VERSION --enable-add-ons && make && sudo make install

You should be running `make check' to ensure your build and environment are working.


I forgot about that, thanks.

I compiled a test program with:
$ export VERSION=glibc-2.13; gcc -Wall -Xlinker -rpath=/opt/$VERSION/lib -Xlinker -I/opt/$VERSION/lib/ld-linux-x86-64.so.2 loop.c -o loop.13
$ export VERSION=glibc-2.12.2; gcc -Wall -Xlinker -rpath=/opt/$VERSION/lib -Xlinker -I/opt/$VERSION/lib/ld-linux-x86-64.so.2 loop.c -o loop.12

How does this compare to 2.16?


I don't have 2.16 compiled at the moment, but I do have git compiled from late last week.

$ export VERSION=glibc.git; gcc -Wall -Xlinker -rpath=/opt/$VERSION/lib -Xlinker -I/opt/$VERSION/lib/ld-linux-x86-64.so.2 loop.c -o loop.16
$ time ./loop.16


real	0m9.317s
user	0m9.310s
sys	0m0.000s

$ time ./loop.16

real	0m10.032s
user	0m9.480s
sys	0m0.000s

The x86_64 support has multiple string functions optimized for different processor variants.

What is the actual implementation that was selected at runtime?

How do I tell? This is a 64-bit Intel machine. I also have AMD 64-bit to test with and preliminary testing showed it was slower as well, but I didn't test much on it.

If you step into the function which is the final routine selected to perform the string operation?

Is this what you are asking?

$ gdb ./loop.12
GNU gdb (GDB) 7.0-ubuntu
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/jmontgomery/loop.12...done.
(gdb) break strptime
Breakpoint 1 at 0x400548
(gdb) run
Starting program: /home/jmontgomery/loop.12


Breakpoint 1, 0x00007ffff7af85c0 in strptime () from /opt/glibc-2.12.2/lib/libc.so.6
(gdb) step
Single stepping until exit from function strptime,
which has no line number information.
0x00007ffff7af86c0 in __strptime_internal () from /opt/glibc-2.12.2/lib/libc.so.6
(gdb) step
Single stepping until exit from function __strptime_internal,
which has no line number information.
0x00000000004006d5 in main ()
(gdb)



Judd



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]