Re: g++ optimization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jonathan Wakely wrote on 06/19/2017 08:52 PM:
On 19 June 2017 at 18:28, U.Mutlu wrote:
Andrew Haley wrote on 06/19/2017 07:08 PM:

On 19/06/17 18:00, U.Mutlu wrote:

In a c++ file inside a loop I have the following snippet:
      const bool f = func();
// if (f) break;

If I activate the line with "if (f) break;" then the performance
very much degrades.

Which g++ optimization parameter should I disable (or enable) to keep the
performance?


That depends on how f() is defined.  We need to see a test that we
can reproduce.


It's a simple class member function returning bool:

inline bool func() const
{
//...
}




Try again. We need to see a test that we can reproduce.

Incomplete snippets of code hinting at what you mean do not count.

Luckily in the meantime I've been able to solve the problem by splitting
the code into 2 files and compiling each with slightly different switches
(tried many combinations :-), and of course linking the .o together.
Code now an unbelievable ~15 times faster! :-)

Thx everybody
cu





[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux