GNOME Bugzilla – Bug 647144
Unnecessary redraws in StreamPositionLabel
Last modified: 2011-06-04 04:02:55 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.
Created attachment 185499 [details] [review] Only update duration label when text has actually changed
Created attachment 185502 [details] [review] Remove useless EnsureStyle call. And, while I'm at it, remove the useless call to EnsureStyle.
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?
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.
*** Bug 587141 has been marked as a duplicate of this bug. ***