PDA

View Full Version : Perfomance of Qt Gui Application on Windows



geronimo
29th September 2011, 20:30
Hi
I developed a gui application on linux. The performance on Linux is very good.
But if I compile the program on Windows Xp(MinGW), the performance is very bad.

It seems, that the filling of a QTableWidget with QWidgetItems is very slow on Windows (about 10 times slower, than on Linux).

Maybe you know, how I can work around the problem. Can I optimize the compiler? Or should I try a different compiler (i.e intel c++, ...)?

thank u

wysota
29th September 2011, 20:37
I don't think this is related to the compiler. We're running our software on Windows and we haven't experienced such behaviour. Try profiling your program to see where the slowdown comes from.

geronimo
29th September 2011, 20:48
thank u for reply. OK.
But the inserting is definitely slower on windows.


//f.e.:
QTableWidgetItem* item = new QTableWidgetItem();
int num = 54212;
item->setData(Qt::DisplayRole,num);
mytable->setItem(row,column,item);

wysota
29th September 2011, 20:58
How do you know it is slower?

geronimo
29th September 2011, 21:12
Because I tested it on both platforms and that was the result.
But I'll test it once again and post code tomorrow.

wysota
29th September 2011, 21:15
But how do you know this particular code is slower?

geronimo
29th September 2011, 21:31
I don't know that this particular code is slower.
I guess it. But I'm quite certain that the filling takes more time...

wysota
29th September 2011, 21:46
So don't guess, benchmark it.

ugluk
30th September 2011, 07:39
I've had a similar problem. The solution was to switch from QTreeWidget to QTreeView, maybe the same applies to QTableWidget.

Qiieha
30th September 2011, 16:58
Install the latest MinGW.

geronimo
30th September 2011, 21:13
I tested it again:
Fill QTableWidget with 20000 rows(3 columns):
Linux: about 3 sec
Windows: about 5 min

Then I tried it on a different windows machine. I installed the latest QtCreator and QtLibs and compiled the app. Now it was as fast as on Linux.
But I don't know yet, what's the problem on the first machine. But my problem is solved...

amleto
1st October 2011, 19:07
have you made sure you ar ecomparing release builds with all iterator checking etc turned off?

geronimo
2nd October 2011, 17:03
I tested it with the releases and the debugs, the occurrence was everytime the same...