Work around performance issue with Qt 5.12 and PreviewButtonDelegate.#2003
Conversation
Doh. Thanks. |
|
I removed the workaround added for lp:1776555 but I'm not sure if that was necessary to fix the issue. In general I'm wary of us messing around with QWidget internals (which I believe |
daschuer
left a comment
There was a problem hiding this comment.
Thank you. I have added only some minor comments.
Regarding the Qt5.2 crash fix, I will test if I can reproduce the issue with this branch on Trusty maybe you have fixed it as well.
Else we need to know which is the first version of Qt that has fixed the root cause.
Hopefully we can remove it anyway because Trusty will EOL soon.
| Q_UNUSED(option); | ||
| QPushButton* btn = new QPushButton(parent); | ||
| btn->setObjectName("LibraryPreviewButton"); | ||
| QPushButton* btn = new LibraryPreviewButton(parent); |
There was a problem hiding this comment.
You can use here make_parented
There was a problem hiding this comment.
I could, but I have to return a raw pointer from this method to Qt since it takes ownership, so the parented_ptr wouldn't be documenting much.
|
With this branch, I am not able to crash Mixxx on Trusty like lp:1776555 |
|
The "close and comment" button strikes again, sorry. |
daschuer
left a comment
There was a problem hiding this comment.
Does this resize issue also happens on your device?
… Launchpad Bug #1812763 After upgrading to Qt 5.12, Mixxx idle CPU usage is high (99%) on macOS. Profiling shows LibraryPreviewDelegate::paintItem as one of the hottest functions. It appears to be related to calling QPushButton::setGeometry for each row of the library. My workaround relies on the fact that we only need the QPushButton size to be correct, not its position. On macOS 10.13.6, CPU usage drops from 99% to 50% with this change (and with mixxxdj#1994, idle usage drops to 15%).
Great, thanks for checking.
No :( it works for me -- the delegate is always drawn at the right width when I resize the column. |
d1129b8 to
5c32882
Compare
|
Sorry for rebasing during review, but I wanted testers of this branch to have #1994 included. I didn't change any commits. |
|
If I resize the column far more than needed, the size cycling with the coloum width. |
|
I have tried to debug the resizing issue, but it seems to happen inside the image style code. Thank you. |
Launchpad Bug #1812763.
After upgrading to Qt 5.12, Mixxx idle CPU usage is high (99%) on
macOS. Profiling shows LibraryPreviewDelegate::paintItem as one of the hottest
functions. It appears to be related to calling QPushButton::setGeometry for each
row of the library. My workaround relies on the fact that we only need the
QPushButton size to be correct, not its position.
On macOS 10.13.6, CPU usage drops from 99% to 50% with this change
(and with #1994, idle usage drops to 15%).