After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 647144 - Unnecessary redraws in StreamPositionLabel
Unnecessary redraws in StreamPositionLabel
Status: RESOLVED FIXED
Product: banshee
Classification: Other
Component: User Interface
git master
Other Linux
: Normal normal
: 1.x
Assigned To: Banshee Maintainers
Banshee Maintainers
: 587141 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-04-08 08:27 UTC by Christopher Halse Rogers
Modified: 2011-06-04 04:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Drop unnecessary redraws after calling UpdateLabel (1.44 KB, patch)
2011-04-08 08:27 UTC, Christopher Halse Rogers
committed Details | Review
Only update duration label when text has actually changed (2.84 KB, patch)
2011-04-08 08:27 UTC, Christopher Halse Rogers
rejected Details | Review
Remove useless EnsureStyle call. (1.02 KB, patch)
2011-04-08 09:02 UTC, Christopher Halse Rogers
committed Details | Review

Description Christopher Halse Rogers 2011-04-08 08:27:01 UTC
Created attachment 185498 [details] [review]
Drop unnecessary redraws after calling UpdateLabel

StreamPositionLabel does a bunch of unnecessary redraws, and these cause Banshee to consume a non-trivial percentage of CPU.

The attached patches clean up some of these unnecessary redraws.  The first is mostly just for completeness, since the affected code isn't called often.  The second ensures that the position/duration text has actually changed before updating them.

This drops Banshee's playing-but-otherwise-idle CPU usage from 9-12% to 2-5% on my Core2 Duo system.
Comment 1 Christopher Halse Rogers 2011-04-08 08:27:31 UTC
Created attachment 185499 [details] [review]
Only update duration label when text has actually changed
Comment 2 Christopher Halse Rogers 2011-04-08 09:02:36 UTC
Created attachment 185502 [details] [review]
Remove useless EnsureStyle call.

And, while I'm at it, remove the useless call to EnsureStyle.
Comment 3 Gabriel Burt 2011-04-08 16:31:55 UTC
Review of attachment 185499 [details] [review]:

How about changing UpdateLabel (string) instead to compare to a last_text value, and not call SetMarkup if it hasn't changed?
Comment 4 Gabriel Burt 2011-04-08 16:55:16 UTC
Thanks Christopher, I committed your 1st and 3rd patches, and committed a patch doing what I mentioned in comment #3.  I pushed your 1st and mine to stable-2.0 as well.
Comment 5 Michael Martin-Smucker 2011-06-04 04:02:55 UTC
*** Bug 587141 has been marked as a duplicate of this bug. ***