PDA

View Full Version : QtCreator slow



Talei
8th June 2013, 00:32
Hello,

I have a strange problem and maybe some one found a solution for this one.
Basically QtCreator "hangs" on me during various tasks. Depending on the code length, task that I perform (i.e. "request" class list of member functions typing ./-> in code - the list that's pop-up) or simply randomly I can see the QtCreator does something in "background" and my CPU readings goes to 50% - 90% (dual core machine). During that times QtCreator freezes and nothing can be done. I know that there is a lot that's going in the background but no so much to hangs app.

Hangs, depending on the situation, last from 1sec to 10+sec.

Spec:
OS: Windows XP Sp3
CPU: AMD X2 4200+
Mem: 3GB

QtCreator: 2.7.2 based on Qt 5.1.0 - I did got similar situation on 2.7.0 based on Qt 5.0.2, oddly this didn't happened in Qt 4.x (at least not is such scale)

Any suggestion, besides buying new CPU :), are more then welcome.

wysota
8th June 2013, 08:40
You can try upgrading QtCreator. However it would be more useful if you tried to find a pattern where such hangs occur. Also you could scan your disk for errors, a hanging issue can be the result of inability to read some sector on disk.

Zlatomir
8th June 2013, 08:54
Another reason for hangs, at least with auto-complete functionality can be the including of more that is needed, like for example the "module" include, i remember that i advised someone to include only the headers that he needs and those hangs were fixed, so start with Wysota's advice and if the disk is ok try to get a pattern for the hangs and to check your code for unnecessary includes (don't include whole Qt modules and also use forward declaration everywhere is possible).

wysota
8th June 2013, 13:06
I think indexing is done in a separate thread so it shouldn't cause the whole application to hang.

Talei
9th June 2013, 23:19
Sorry that my question was vague.

Situation is that I have like 50 classes project, and it's growing. I always include only necessary Qt classes, so there is no "#include <QtGui>", but because I have 50 classes the slowdown that I was experiencing was mostly on top level classes that include some of the smaller classes. These classes also include something, not much, but I did found out hard way that's to much to handle by my current CPU.

Hangs was when i.e. I hovered mouse over class member or moved there text pointer / indicator, with the auto completion (that was just ...) or with object member po-pup window. So QtCreator probably parsed out all includes and of course their children and hence slowdown.

Using forward declaration whenever I could solved the problem.

Note: Compilation time decreased from (around) 1 min 2sec to 52 sec. Not much but better then was previously. Only drawback is no more: http://xkcd.com/303/ :rolleyes:

Thank You for the answer.

PS. HDD is of course ok.

Brodon
4th July 2013, 07:01
I don't understand your information.Please explaine your topic clearly.