Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#3887 closed Bug (fixed)

High CPU use when using Murrine theme

Reported by: Rolcol Owned by: jordan
Priority: Normal Milestone: 2.20
Component: GTK+ Client Version: 2.13
Severity: Normal Keywords:
Cc:

Description

If the current filter has any paused torrents, scrolling through the list causes the GTK client to use 100% cpu. The window usually becomes unresponsive.

Attachments (2)

gprof-transmission.bz2 (37.8 KB) - added by Rolcol 11 years ago.
murrine.diff (12.0 KB) - added by jordan 11 years ago.

Download all attachments as: .zip

Change History (14)

comment:1 Changed 11 years ago by jordan

Rolcol, could you try getting a CPU profile of this behavior?

Changed 11 years ago by Rolcol

comment:2 Changed 11 years ago by Rolcol

Tell me if that's not correct.

comment:3 Changed 11 years ago by jordan

It looks like that gprof report thinks all the time was split three ways between these functions:

 33.33      0.01     0.01    37268     0.27     0.27  tr_isSession
 33.33      0.02     0.01     3965     2.52     4.40  tr_torrentStat
 33.33      0.03     0.01                             evmap_io_del

which doesn't look correct. (Although it did get me to wondering where we're calling tr_torrentStat() from when we should be using tr_torrentStatCached(), which led to #3897 and #3896, so it wasn't a waste of time. :)

I tried running "valgrind --tool=cachegrind ./transmission-gtk -p -g /tmp/transmission-test" where /tmp/transmission-test consisted of about 10 paused torrents, then scrolled the list up and down for about a minute before exiting. The results think that almost all of the time is being spent in pango or cairo doing rendering.

I'm not seeing any different behavior on paused torrents than I am on nonpaused ones.

Does the problem persist if you change desktop themes?

Last edited 11 years ago by jordan (previous) (diff)

comment:4 Changed 11 years ago by jordan

Rolcol: your mention of paused torrents reminded me of something, but I couldn't remember what until just now. It echoes this bug report I saw a couple of months ago:

I've figured out the the number of torrents affects the cpu usage. When I

only have 2 torrents queued up, regardless of running or not. Transmission uses 4-8%, and another 1-2% is added for every torrent that is added to list. For some reason, paused torrents are using cpu resources.

That was reported for murrine themes in Ubuntu, and doesn't happen in other themes:

https://bugs.launchpad.net/ubuntu/+source/transmission/+bug/655024

I don't know if that's the cause of the issue you're seeing. But, if you're using one of Ubuntu's themes, it might be worth testing a non-Ubuntu theme for comparison.

comment:5 Changed 11 years ago by Rolcol

Huh... It looks like you're right. I switched over to clearlooks and the problem seemed to go away.

comment:6 Changed 11 years ago by jordan

  • Resolution set to invalid
  • Status changed from new to closed

I would like this problem to be fixed, but I don't think it can be done at the Transmission level.

You might want to chime in on that launchpad ticket so that upstream doesn't forget about it. ;)

comment:7 Changed 11 years ago by jordan

r11740:

(trunk gtk) companion commit to r11738 to reduce unnecessary re-rendering in the main window

The main window called gtk_tree_model_filter_refilter() once per second to refresh the torrent list's filtering. This is not an efficient approach: gtk_tree_model_filter_refilter() emits a "row changed" event for every row, causing unnecessary re-rendering.

I've removed the call to gtk_tree_model_filter_refilter() and expanded the model to include all the fields necessary for filtering. That way we only fire "row changed" events for rows that actually change.

By reducing the number of renders in steady state, this might ameliorate https://bugs.launchpad.net/ubuntu/+source/transmission/+bug/655024

However it will *not* help the related "CPU spikes to 100% on scrolling" ticket at https://trac.transmissionbt.com/ticket/3887 because rendering paused torrents is still exceptionally expensive in the murrine theme.

Last edited 11 years ago by jordan (previous) (diff)

comment:8 Changed 11 years ago by jordan

rolcol, could you try applying "murrine.diff" to a trunk build and see if it resolves the problem when using the Ubuntu themes instead of clearlooks?

It's a hack, but it might be useful as a "Plan B" if upstream doesn't fix their bug in time for 11.04.

comment:9 Changed 11 years ago by jordan

  • Milestone changed from None Set to 2.20
  • Resolution invalid deleted
  • Status changed from closed to reopened

Changed 11 years ago by jordan

comment:10 Changed 11 years ago by Rolcol

Yep, that patch does make a big difference.

comment:11 Changed 11 years ago by jordan

  • Resolution set to fixed
  • Status changed from reopened to closed

jordan * r11747 gtk/torrent-cell-renderer.c: (trunk gtk) #3887: "CPU spikes to 100% on scrolling" -- workaround committed.

The patch avoids use of GtkCellRendererText?'s "sensitive" property, and instead renders paused torrents' text using the widget's style's color for insensitive text. This approach honors the theme's "insensitive" color setting and uses it to draw insensitive text with no etching or shadowing.

The better option is still for Murrine to fix its text shadow issue... but until then, here is a workaround.

comment:12 Changed 11 years ago by jordan

  • Summary changed from CPU spikes to 100% on scrolling to High CPU use when using Murrine theme
Note: See TracTickets for help on using tickets.