|
|
Thiago Macieira wrote:
>Andy Brice wrote:
>>The default compiler optimisation flags set by Qt are:
>>
>>-O1 (Visual Studio)
>>-Os (GCC)
>>
>>But I did some experiments with my genetic algorithm code and found
>>these weren't the best settings for me. If you are interested the
>>results are here:
>>
>>http://successfulsoftware.net/2007/12/18/optimising-your-application/
>>
>>best regards
>>
>>Andy Brice
>>http://www.perfecttableplan.com
>
>Thanks Andy,
>
>That was a very interesting read. Ten times speed improvement is
> something to be proud of.
Of course, I forgot to say the other thing I was going to say:
Any Qt application that uses the Tulip classes is extremely slow if built
without optimisation. Especially in gcc, where -O0 means no optimisation
at all (even some warnings are disabled in -O0 because the code that
detects the issue is tied to the optimiser).
The reason for that is that the Tulip classes are using mostly inlined
code. There are only a few non-inline functions to be called, mostly only
when needing to reallocate the collection or rehash it. But, when not
using optimisation, all function calls are out-of-line, which means
there's a huge overhead of function calls.
[gcc's -O0 should be understood as "generate dumb code" -- if you read the
assembly output, you know you can do better than gcc. I remember looking
into the disassembly of a portion of Qt on one of our Itanium boxes and I
found a code sequence that was doing the following to a value: copy from
r33 to r14, save from r14 to memory, load from memory to r37, call other
function.]
--
Thiago José Macieira - thiago.macieira AT trolltech.com
Trolltech ASA - Sandakerveien 116, NO-0402 Oslo, Norway
|
|