PDA

View Full Version : Qt/mingw a lot slower than borland builder 6.0?



qt_gotcha
22nd February 2010, 09:38
I have an application which is a waterbalance model that runs in 300 loops and shows the results in a series of labels on an interface. A button creates and starts the thread that is the model. The model is coded in c++ and I could port it directly to Qt/Mingw using Eclipse, from borland builder c++ 6.0. So the model code is exactly the same.
The weird thing is that in Borland the model runs in 17 seconds, in Qt 4.6.1 it runs in 26.5 seconds.
There is one difference though, in Qt the Borland the model is directly called in Qt it is a Qthread, but also if I switch of the interface the runtime is nearly the same (a lot slower than BCB).

Is the Qthread making the model slower? or is it mingw? Or is this a mingw question? Most of the data is grid based, so a lot of times "for c = 0 to nrcols, for r = 0 to nrRows", could it be that borland does that faster? Both are compiled as debug without optimizations.

This is with a small database but a larger database may easily be 30 minutes so before I continue in Qt I would like to be sure it is not a lot slower.

Has anyone experienced this?

thanks

qt_gotcha
22nd February 2010, 12:39
tried the borland with the thread function, still a loy faster...

qt_gotcha
23rd February 2010, 12:11
I found that the -ffast-math compiler makes a nice difference. My app does liots of calculations like powl, sqrt, log and those are slow in migw, but the fast-math compiler switch changes that, it runs now 20% faster. I am now recompiling the entire qt directory with fast-math activated and optimization to O3. I'll report what that does.