Performance degradation on g++ 4.6

Oleg Smolsky oleg.smolsky@riverbed.com
Tue Aug 23 01:09:00 GMT 2011


Hey David, these two --param options made no difference to the test.

I've cut the suite down to a single test (attached), which yields the 
following results:

./simple_types_constant_folding_os (gcc 41)
     test         description   time   operations/s
      0 "int8_t constant add"   1.34 sec   1194.03 M

./simple_types_constant_folding_os (gcc 46)
     test         description   time   operations/s
      0 "int8_t constant add"   2.84 sec   563.38 M

Both compilers fully inline the templated function and the emitted code 
looks very similar. I am puzzled as to why one of these loops is 
significantly slower than the other. I've attached disassembled listings 
- perhaps someone could have a look please? (the body of the loop starts 
at 0000000000400FD for gcc41 and at 0000000000400D90 for gcc46)

Thanks,
Oleg.


On 2011/8/1 22:48, Xinliang David Li wrote:
> Try isolate the int8_t constant folding testing from the rest to see
> if the slow down can be reproduced with the isolated case. If the
> problem disappear, it is likely due to the following inline
> parameters:
>
> large-function-insns, large-function-growth, large-unit-insns,
> inline-unit-growth. For instance set
>
> --param large-function-insns=10000
> --param large-unit-insns=20000
>
> David
>
> On Mon, Aug 1, 2011 at 11:43 AM, Oleg Smolsky<oleg.smolsky@riverbed.com>  wrote:
>> On 2011/7/29 14:07, Xinliang David Li wrote:
>>> Profiling tools are your best friend here. If you don't have access to
>>> any, the least you can do is to build the program with -pg option and
>>> use gprof tool to find out differences.
>> The test suite has a bunch of very basic C++ tests that are executed an
>> enormous number of times. I've built one with the obvious performance
>> degradation and attached the source, output and reports.
>>
>> Here are some highlights:
>>     v4.1:    Total absolute time for int8_t constant folding: 30.42 sec
>>     v4.6:    Total absolute time for int8_t constant folding: 43.32 sec
>>
>> Every one of the tests in this section had degraded... the first half more
>> than the second. I am not sure how much further I can take this - the
>> benchmarked code is very short and plain. I can post disassembly for one
>> (some?) of them if anyone is willing to take a look...
>>
>> Thanks,
>> Oleg.
>>

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: benchmark_shared_tests.h
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20110823/2a037d3c/attachment.h>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: simple_types_constant_folding_os.cpp
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20110823/2a037d3c/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: simple_types_constant_folding_os-41.lst
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20110823/2a037d3c/attachment-0001.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: simple_types_constant_folding_os-46.lst
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20110823/2a037d3c/attachment-0002.ksh>


More information about the Gcc mailing list