0

Hi I am student programmer using Qt to build some editing applications for work and I'm hitting an issue in my debugging practices that I am not sure how to approach. I have QTableWidget that takes at least 10 secs to fill when 100+ rows are brought in.

I am wondering if Qt's debugger has any tools to help pinpoint where the operation is taking the most of its time at. I have looked over the operation several times and everything looks right and efficient so I am left pretty lost. I have looked over the debugging and analyzing sections of the debugger and didn't see anything that looked helpful as I'm pretty sure my symptoms aren't that of a memory leak. Thanks for reading my post and thanks in advance for any help in this issue.

Wylie Coyote SG.
  • 1,009
  • 6
  • 22
  • 37
  • 1
    Probably better off with some profiling tools, what platform are you on? Also my guess would be that adding rows causes some resize operation or some signals to be emitted. Maybe you could suppress those while adding rows. – r_ahlskog Sep 11 '12 at 08:32
  • Perhaps I'm looking into qt profiling now; I'm using Linux Mint. – Wylie Coyote SG. Sep 11 '12 at 19:56
  • 1
    Ah Linux, good then you have the full suite of tools. Can use the valgrind tool callgrind to see what is going on and what is taking time. Good hunting. – r_ahlskog Sep 13 '12 at 08:44
  • ahlskog good call! I was able to find my bug given your advice please post your comment in the form of an answer and try to be as inclusive as possible for future answer hunters that hit this page! seems like the title of this post might become pretty popular! – Wylie Coyote SG. Sep 13 '12 at 23:46

1 Answers1

1

If you are having performance issues and want to see where in your application time is spent you need to do some Profiling. Depending on your platform and chosen IDE the tools differ and you should look into what is most commonly used.

For Linux there are few tools to pick from. One I found quite helpful is the Valgrind tool Callgrind, there is a quite nice visualizer for it called KCachegrind that should be available in your distributions repository.

Since you are using Qt there is a real possibility that you also use Qt Creator then I found something on the integration of Valgrind in Qt Creator.

r_ahlskog
  • 1,916
  • 1
  • 17
  • 26