Pinpointing bottlenecks in UI thread
-
I am observing that my UI is rather slow. I tried to offload as much work as possible off of the UI thread. Even though I got improvement, I still feel like it could be faster. Maybe I should profile the code. What is your strategy in this situation? Which tools/profilers are you using? I want to know which functions/code blocks incur overhead.
-
I am observing that my UI is rather slow. I tried to offload as much work as possible off of the UI thread. Even though I got improvement, I still feel like it could be faster. Maybe I should profile the code. What is your strategy in this situation? Which tools/profilers are you using? I want to know which functions/code blocks incur overhead.
@ozcanay said in Pinpointing bottlenecks in UI thread:
Which tools/profilers are you using?
You won't get much pertinent answers if you don't say what platform you are interested in developing on!
Speaking for Linux, unfortunately I have to report they they, and Qt Creator, want you to use the Linux
perftool. While it may be very powerful, I was an experienced user with the oldergprofand that worked fine and was easy to understand. IMHOperfis a nightmare to attempt to understand, not to mention to install and get working at the OS level. I think you need a degree in "perf-understanding" to get anywhere with it :( If you are Windows and using MSVC/Visual Studio you may be more successful with their inbuilt profiler.A year or so ago I asked this community which profiling tools they used to analyse their Qt programs' performance, and was surprised/disappointed to be met by a deafening silence. The "community" seemed not to use performance analysis tools. I was as horrified as you might be! So good luck.....
I gave up on profiling and put in relevant
QElapsedTimers around high-level bits, then moved them down to lower-level bits till I had a general idea of where time was being spent. Not ideal --- like using print/debug statements instead of stepping through a debugger --- but better than nothing. -
Hi,
KDAB's Hotspot might help you with the use and analysis of perf.
-
I am on Linux. To be honest, I had looked in perf and it really was not easy to grasp for me, too. Did not look into gprof.
