This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC 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: The application performance built from gcc 7.1 is very worse compared to gcc 6.3


Hi Andrew,

> Nobody knows, because nobody except you knows what your program does.
We need a test case.

Thanks for your comments!

Hi Ruoyao,

> (1) "-fprofile-arcs" slows down your program since it add code into
    your program to record branch probabilities.  If you want to optimize,
    use "-fbranch-probabilities".  (See the man page of GCC.)
> (2) "-O2 -ftest-coverage" may produce strange coverage result.
    If you want to test coverage with gcov, it's better to disable all
    optimization (with -O0).

Yes, you are right!
After remove "-fprofile-arcs -ftest-coverage" (Now the compile option
is: -g -O2 -fopenmp -fPIC -std=gnu++11),
the gcc 7.1 generate the same fast code as gcc 6.3.

> Which package are you building?  If it's open source, please send a link
here and maybe someone can reduce it for a test case.  Then the developers
of GCC may fix the regression.  But if possible I suggest you to create
a test case (simple enough) by yourself and report it to
<http://gcc.gnu.org/bugzilla>.

It is our private project, and unfortunately can't be open sourced.
Although the computation logic is a little complicated,
I will try to see whether I can reduce it to a test case.

>  And please tell us your architecture (i686 or x86_64).
My server's architecture is x86_64.

Thanks very much again for your quick answer and kind help! :-)
Best Regards
Nan Xiao


On Thu, Jun 1, 2017 at 4:32 PM, Xi Ruoyao <ryxi@stu.xidian.edu.cn> wrote:
> On 2017-06-01 15:59 +0800, Nan Xiao wrote:
>> Hi all,
>>
>> Greetings from me!
>>
>> My OS is ArchLinux, and on this Monday, I upgrade gcc from 6.3.1 to
>> 7.1.1 (both packages are released by ArchLinux). But after rebuilding
>> my program, I find the performance downgrades drastically.
>>
>> For single-thread version, the program which is built with "gcc 6.3.1"
>> would use ~85 seconds to process a transaction; while with "7.1.1", it
>> grows to ~115 seconds.
>> For multiple-thread version using OpenMP, the  program which is built
>> with "gcc 6.3.1" would use  only ~11 seconds to process a transaction;
>> while with "7.1.1", it grows to ~50 seconds.
>>
>> The compile and link flags are " -g -O2 -fopenmp -fprofile-arcs
>> -ftest-coverage -fPIC   -std=gnu++11 ".
>>
>> I also download and build gcc 7.1 myself from
>> https://gcc.gnu.org/gcc-7/, the single-thread program can use ~95
>> seconds, while OpenMP version still consumes ~50 seconds. So compared
>> to program built using gcc 6.3, the performance is very worse.
>>
>> I have checked the release note of gcc
>> (https://gcc.gnu.org/gcc-7/changes.html), but can't find some valuable
>> information.
>>
>> Could anyone give some comments? Thanks very much in advance!
>>
>> Best Regards
>> Nan Xiao
>
> Sadly, GCC has some annoying performance regressions.  But I think at
> first you could change your compile flags:
>
> (1) "-fprofile-arcs" slows down your program since it add code into
>     your program to record branch probabilities.  If you want to optimize,
>     use "-fbranch-probabilities".  (See the man page of GCC.)
> (2) "-O2 -ftest-coverage" may produce strange coverage result.
>     If you want to test coverage with gcov, it's better to disable all
>     optimization (with -O0).
>
> Which package are you building?  If it's open source, please send a link
> here and maybe someone can reduce it for a test case.  Then the developers
> of GCC may fix the regression.  But if possible I suggest you to create
> a test case (simple enough) by yourself and report it to
> <http://gcc.gnu.org/bugzilla>.
>
> And please tell us your architecture (i686 or x86_64).
> --
> Xi Ruoyao <ryxi@stu.xidian.edu.cn>
> School of Aerospace Science and Technology, Xidian University
>


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