Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.4.1
-
None
-
-
53ecaade10319ecc1d8115521ae6d8eba1ee55c1
Description
Attached is a zip file with simple Qt application that creates a QMainWindow with a QSatusBar, and calls update() on the status bar 10 times per second.
The mac machine I am using is an absolute beast (see specs.png), and even on this machine the application steadily consumes about 20% CPU usage - which is absurd since it does practically nothing.
It seems the reason is because updating the status bar will trigger a repaint of the main window, which will result in the entire main window's image being copied in QImage::detach(). The reason we copy the image before we paint it is because somebody else holds a reference to the main window's image data (I suspect in libqcocoa.dylib).
Thus, we are copying the entire main window's image data every time a tiny widget is updated. Extrapolate that to a more complex application and it's obvious that things will be very uncomfortable.
I collected some profiling results (see profiling.png and pi.trace) that verify we spend a huge amount of time inside QImage::copy(), just by letting the app run idle for about a minute.
Is there something I am missing here? I could not find any similar bug reports, and it does not appear to be fixed with Qt 5.4.2.
Attachments
Issue Links
- is required for
-
QTBUG-46863 Issues to be fixed before Qt 5.5.1
- Closed