Closed Bug 562977 Opened 15 years ago Closed 1 year ago

thunderbird indeterminate xul:progressmeter progress bar activity puts CPU at 20% - 100%

Categories

(Thunderbird :: Mail Window Front End, defect)

x86
All
defect

Tracking

(thunderbird_esr78 wontfix)

RESOLVED WORKSFORME
91 Branch
Tracking Status
thunderbird_esr78 --- wontfix

People

(Reporter: hunteke, Assigned: Paenglab)

References

(Depends on 1 open bug)

Details

(Keywords: leave-open, perf, Whiteboard: [battery][dupeme?])

Attachments

(5 files, 1 obsolete file)

User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.3) Gecko/20100423 Ubuntu/10.04 (lucid) Firefox/3.6.3 Build Identifier: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.3a5pre) Gecko/20100426 Shredder/3.2a1pre Symptom: any progress bar that appears seems to bring with it a pegged CPU core. I suggest it's the progress bar code that is polling the CPU. If I send a message, and the send process fails for some reason, the progress bar continues to animate, while a new dialog box appears with a reason for error. Meanwhile, a CPU core is still pegged, even though there is no "real" work being done, just the progress bar animation. I've noticed the high CPU core usage with *any* progress bar activity, not just the above example. For example, on this latest build, the progress bar in the lower right is attempting to complete while I type this bug report, I presume while it indexes for the first time (first time with /this/ build) my inbox,(>8000 messages). Meanwhile, my CPU graph shows one core in full usage. Reproducible: Always Steps to Reproduce: Here is one method to get a status bar 1. Open Thunderbird. 2. Clear your password 3. Send a message 4. Type in an incorrect password 5. Note the CPU usage when it gives you the SMTP error dialog. If it matters, I'm using IMAP, but again, I doubt that's the issue. I think it's the scroll bar code. Actual Results: When any progress bar is visible, a processor goes berserk. Expected Results: When any progress bar is visible, the CPU usage caused by the progress bar should be pert near zero. These bugs may be relevant, or may turn out to be duplicates. I couldn't quite tell from the descriptions: bug 367431 bug 538283 bug 543422
Another reason why I think the issue is specifically with the progress bar code and not, for example, the Gloda code: this issue has been around since at least Thunderbird v1.5. As referenced by Bug 543422, Gloda may *also* be a CPU hog, but I think the this merits it's own bug report.
Kevin, I don't put any stock in those other bugs. Are you seeing this mainly with trunk build? ( Trunk builds are currently badly broken.) Do you see this issue with indexing disabled? (restart after disabling) If it's only with indexing enabled, can you follow the first two steps at https://developer.mozilla.org/en/Thunderbird/Gloda_debugging, this should show you errors in the error console.
Component: General → Mail Window Front End
Keywords: perf
QA Contact: general → front-end
Version: unspecified → Trunk
Index disabled, restarted. Problem persists. I checked with both the stock Ubuntu Lucid version (v3.0.4) and with the trunk version built 4 days ago (2010 Apr 26). I recreated the issue as I described above, removing my saved password, sending an email, and then pausing to observe the effects when it asked for my password. High CPU usage until I canceled the "Give me your password" dialog.
John McPherson just performed a perhaps telling strace of Thunderbird 3.0.4: https://bugs.launchpad.net/ubuntu/+source/thunderbird/+bug/109943/comments/15 The telling bit from his comment: It looks like the animation code is doing something very inefficient if it's calling gettimeofday() thousands of times per second. From there, here's a similar analysis on May 12th's nightly build: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.3a5pre) Gecko/20100512 Shredder/3.2a1pre ---------- $ ps -elF | grep thunderbird 0 S kevin 27405 26060 10 80 0 - 99236 poll_s 81960 1 15:06 pts/0 00:01:33 ./thunderbird-bin 0 S kevin 30204 29053 0 80 0 - 1904 pipe_w 916 0 15:20 pts/2 00:00:00 grep --color=always thunderbird $ time strace -p 27405 2>&1 | head -10000 | grep gettimeofday | wc -l 3803 real 0m2.532s user 0m0.200s sys 0m0.440s ---------- That's almost 4,000 requests for gettimeofday() in 10,000 lines retrieved by strace, all in 2.5 seconds. The question is why does some piece of code need to know gettimeofday several thousand times per second? Note that to recreate this, the same trick of "forgetting" the password when sending a message was used. Also note that indexing is *still* disabled. No Gloda.
Peter, Nir Does this reproduce in your environment? And even if it doesn't, any thoughts or advice? Kevin as a practical matter - is it at 100% during the entire time the progress bar is animated?
I have 2 cores on my machine. Speaking as an end-user, yes, a single core is pegged at 100% during the entire time the progress bar is active.
Kevin, do you still see this problem in version 3.1? Do one of the bugs in comment 0 really describe your problem well?
Whiteboard: [closeme 2011-03-01]
(In reply to comment #7) > Kevin, do you still see this problem in version 3.1? Yes, but not nearly as badly. Now the CPU is about 20%, not 100%. To be clear, I believe from personal experience that animating a simple scroll bar and waiting for user input ought to register at 1% or less CPU utilization. Performing a similar analysis as above, with Thunderbird waiting for a password (and consequently with a scroll bar going), yields the number of gettimeofday calls to be in the same vicinity (3,500 to 4,000 calls) in 10,000 lines retrieved via strace, and a much more consistent 2,275 POLL events. Note that I just downloaded and tested Mozilla's copy of 3.1.7 (not my distribution's). > Do one of the bugs in comment 0 really describe your problem well? No. I wasn't sure at the time I wrote this bug report, but I became more confident later.
with trunk Thunderbird on windows, I see steady cpu usage of 5-30% (avg 9%) when any modal dialog box is up (error, password, etc). Thus, I suspect this is a duplicate. when NOT logged in to imap account and no dialog box left open, ~2% (new bug?) when logged in to imap account, and no dialog box left open, ~0%
Severity: normal → minor
OS: Linux → All
Summary: thunderbird progress bars ping core at 100% → thunderbird progress bar at 20%
Whiteboard: [closeme 2011-03-01] → dupeme?
I encountered this issue with 64-bit Thunderbird 5.0 on Linux (Debian). When the progress bar oscillates between left and right, CPU usage increases so that one of CPU cores is at 100%. For now, I downgraded to TB 3.1.11, that doesn't show this issue or, at least, not to such an extent.
Tsu, Kevin, does CPU go down substantially if you start thunderbird in safe mode? (as it does in Bug 693852) ref: http://support.mozillamessaging.com/en-US/kb/safe-mode
I have just updated the original test with a stock (direct from mozilla.org) copy of Thunderbird, version 7.0.1 (64-bit). Answer: no. It remains high, between 20% and 50% of a core. That other bug sounds related, and I would not be surprised if the buggy code is at least partially shared.
Thunderbird 8.0 also suffers from this bug.
Summary: thunderbird progress bar at 20% → thunderbird progress bar activity puts CPU at 20%
This has been happening to me for years, and still happens in 12.0.1. I'm pretty surprised this hasn't gotten more attention. I've had cases where it completely pegs a core- 99 or 100%.
This was the only reason I left TB and used Evolution (in Gnome).
As of yesterday, I've gotten fed up with the resource hogishness and stability issues of the default Ubuntu window and desktop managers. I've now installed and configured OpenBox. Where I was seeing this issue 3 days ago (albeit not as pronounced as once-upon-a-time), I'm now do not notice anything. Other than a 4 or 5 second wait to quit TB, things are right-zippy, with no (known) loss of functionality. I don't know how to confirm, but this certainly leads me to suspect an interaction between Thunderbird and Gnome and Unity. (And I believe KDE too, but it's now 4 years since I last tried KDE ...) Another data point.
(In reply to Kevin Hunter from comment #16) > As of yesterday, I've gotten fed up with the resource hogishness and > stability issues of the default Ubuntu window and desktop managers. I've > now installed and configured OpenBox.
Err, to clarify what I think you may be focusing on, the pegged cores were very much attributable to TB (as evidenced by Comments #4 and #8, and my personal observations through ps and htop, etc.), not to the the various Window/Desktop managers. For purely non-TB reasons, I switched to OpenBox: my computer /really/ bogged down after I installed Ubuntu 12.04 (fresh install -- not upgrade -- if it's of use) on my machine last week. (This is still the same hardware as when I started this bug report.) The speedup of Thunderbird was a happy coincidence, and was not an intentional reason for my switch. TB definitely still has a performance issue, but one that may be exacerbated by the interaction between the more well-known WMs and DMs.
Severity: minor → normal
Status: UNCONFIRMED → NEW
Ever confirmed: true
Whiteboard: dupeme? → [battery][dupeme?]
there is also activity manager. <Archaeopteryx> wsm: seem like it starts here: http://mxr.mozilla.org/comm-central/source/mail/components/activity/modules/autosync.js#283 <Archaeopteryx> and onProgressChange gets called too much: http://mxr.mozilla.org/comm-central/source/mail/components/activity/content/activity.xml#485 <wsm> Archaeopteryx: see also https://bugzilla.mozilla.org/show_bug.cgi?id=742697#c14 <firebot> Bug 742697 nor, --, ---, acelists, NEW, SMTP connection progress bar causes high CPU usage <wsm> how do you know it is called too much? <Archaeopteryx> just a guess because i see no throtteling code. autsync's comment says it want to prevent event overflow, but it don't see bundling messaes per account at http://mxr.mozilla.org/comm-central/source/mail/components/activity/modules/autosync.js#249 which calls setProgress. you could verify with logging enabled, onDownloadStarted logs in the first lines
That is the question. I have not yet found if there is any throthling or how often these onProgressChange events are fired. I should probably get the time inside the handler and dump it out to see what happens. Wayne can you come up with good STRs to get a progress bar repeatedly without downloading new messages? So that we can debug the code.
(In reply to :aceman from comment #22) > Wayne can you come up with good STRs to get a progress bar repeatedly > without downloading new messages? So that we can debug the code. bug 791535 is a different situation, but is reproducible. I assume bug 584643 is also reproducible. collection of related bugs - https://bugzilla.mozilla.org/buglist.cgi?list_id=5125237;short_desc=progress%20activity%20barber%20spin%20spinner%20spinning;field0-0-0=short_desc;type0-0-1=anywordssubstr;field0-0-1=short_desc;resolution=---;query_format=advanced;short_desc_type=anywords;value0-0-1=indicat%20throb;type0-0-0=anywords;value0-0-0=meter%20bar%20pole;product=MailNews%20Core;product=Thunderbird
That query is not that good, from 21 bugs there are about 3 about this problem. You should probably add 'CPU' as a needed word.
(In reply to :aceman from comment #24) > That query is not that good, from 21 bugs there are about 3 about this > problem. You should probably add 'CPU' as a needed word. sorry, quite right. I was mainly being hasty/lazy and I didn't mean to imply ALL are related. Looks to be about 1/3. Most relevant are bug 791535 and bug 742697 I was also being loose because a few bugs which don't cite CPU still are likely impacted. for example bug 47024, bug 584643
Recent profile http://people.mozilla.org/~bgirard/cleopatra/?1387475933880#report=1757ae9e3f70bc2dff02d261c2782ebdba77872e done under conditions of gmail stuck on "Downloading m of n All Mail" (bug 816327) The amount of time spent painting is obscene (screen shot of profile to follow)
Blocks: 791535
Flags: needinfo?(mconley)
Flags: needinfo?(acelists)
Holy crap, yes, we're spending a *lot* of time painting in that profile. What is being drawn during this sluggishness?
Flags: needinfo?(mconley) → needinfo?(vseerror)
Flags: needinfo?(vseerror)
What was being displayed on screen during this?
Flags: needinfo?(vseerror)
Attached image TB gmail up to date progress bars (deleted) —
screen shots of progress bar. Note, apparently CPU can be way higher than 20% depending on type of activity. In the case of waiting for gmail, I'm seeing 60-100% CPU used by Tbird.
N.B. there may be differences in throbber resource usage depending on OS, as suggested in Bug 854093 - Indeterminate progress bar takes entire CPU.
Flags: needinfo?(vseerror)
Supposedly fixed: Bug 304147 - progressmeter in undetermined mode does not work in Mac OS X Bug 420254 - thunderbird often uses ~10% cpu when idle for no apparent reason Bug 432028 - Undetermined progressmeter timer isn't stopped, causing high CPU load Bug 586216 - Animated widgets have one timer per widget Bug 587876 - Undetermined progress bars should use mozRequestAnimationFrame Bug 704171 part 1. Stop using the no-argument form of mozRequestAnimationFrame in our chrome
(In reply to Mike Conley (:mconley) from comment #27) > Holy crap, yes, we're spending a *lot* of time painting in that profile. > What is being drawn during this sluggishness? Does this contradict comment 32's bug list? And what about bug 658829 and bug 729649 (both landed in early 2013) cited in bug 791535?
Does anybody still see this? With TB32, in Win XP I can't see the high CPU usage any longer. Via DOM Inspector, in TB main window (chrome://messenger/content/messenger.xul) I found <statusbarpanel id="statusbar-progresspanel"> where I set collapsed="true" to uncover the status bar progress meter. Then in <progressmeter id="statusbar-icon"> I set mode="undetermined". The progress bar began spinning without much CPU usage. So the progressbar alone doesn't seem to be the culprit. If we can find the CPU usage in other scenario, maybe something else is contributing to it.
Flags: needinfo?(acelists)
As of v24.5, running on Ubuntu 13.10 (64bit) with Openbox, I no longer see gettimeofday calls in the strace output. TB is still polling like mad, but is at least efficiency polling. From an strace output like above, I now see: (11.6%) futex (27.4%) poll ( 4.0%) read (45.3%) recvfrom (11.7%) writev And no gettimeofday. So, from the reporter, who has unfortunately changed the desktop he uses (see comments 16, 17, and 18), I no longer see this. Meanwhile, we still need input from someone running Gnome and Unity, I think.
This bug still exists. When the SMTP server does not respond (e.g, with misconfigured IP address setting), I get 12-13% CPU load in my i5 macbook until the connection timeouts.
Thanks Wayne for bringing attention back also to this bug. I can confirm that the bug still exists with the latest released TB version 31.3.0 with a cpu usage increase of about 12-13% on my Macbook Air. As I wrote recently in response on your request regarding the (likely related) bug 919485, unfortunately I cannot afford the time to install the trunk version and use profiling tools. Yet anyone interested could do for himself easily, since this bug can be reproduced in a straightforward way: put any garbage IP address as e.g. the IMAP (or POP or SMTP) server name and try receiving (or sending, respectively) emails. I suspect that this waste of CPU (and battery on mobile devices!) is due to the same careless chunk of code performing a busy loop somewhere deep in Mozilla's TCP client connect implementation. BTW, the title of this bug report is misleading, as it is too narrow: the misbehavior also occurs without any progress bar being shown, e.g., when trying to fetch emails.
Here is a trace while copying emails between folders on an IMAP server. Some work is actually being done, but there seems to be a lot of time spent in Paint::PresShell::Paint nsLayoutUtils::PaintFrame nsDisplayList::PaintRoot https://people.mozilla.org/~bgirard/cleopatra/?1418817484580#report=f2ec94e59158f41a3723d4d2d517587d1476ab41
WAG: Just a guess. Go to about:config and set the following preferences: layers.acceleration.disabled -> true layers.offmainthreadcomposition.enabled -> false
(In reply to David von Oheimb from comment #39) > Thanks Wayne for bringing attention back also to this bug. > > I can confirm that the bug still exists with the latest released TB version > 31.3.0 with a cpu usage increase of about 12-13% on my Macbook Air.... > > I suspect that this waste of CPU (and battery on mobile devices!) is due to > the same careless chunk of code performing a busy loop somewhere deep in > Mozilla's TCP client connect implementation. David, can you do a performance profile during a period of high CPU using the procedure at https://developer.mozilla.org/en-US/docs/Tools/Remote_Debugging/Thunderbird which uses Firefox as the recorder - follow instructions at https://developer.mozilla.org/en-US/docs/Tools/Remote_Debugging/Thunderbird - after connect, pick "main" - click "Performance" in the developer tool menu - click "start recording performance" in the center - do some actions in thunderbird which cause the problem or behavior to be recorded - click "stop recording performance" in the center - click "Save" one the left - email the json file or attach to this bug report
Flags: needinfo?(mueller8)
Here is the requested performance profile with TB 45.6.0 on a Mac. (The setup for getting it was a bit involved, using both FF and TB, but ok.) Note that anyone can easily reproduce this CPU misuse: Just set the IMAP Server Name of some account to an unreachable IP address like 1.2.3.4 and try getting emails from there. This bug is apparently very low-level in the Mozilla network layer and has a number of related bug reports touched again recently also for FF.
Flags: needinfo?(mueller8)
High CPU usage seems to be caused by status bar animation. Quick fix for me (works on Ubuntu) is to disable the status bar (for now). Possible fix for THunderbird team: Remove this animation, and possibly the entire current animation subsytem, and replace all progress bar animations with something simpler, as I suspect that possibly all animations currently use high CPU usage, but on a decent net connection they do not display for very long (Jut a thought)
(In reply to :aceman from comment #35) > Does anybody still see this? With TB32, in Win XP I can't see the high CPU > usage any longer. Via DOM Inspector, in TB main window > (chrome://messenger/content/messenger.xul) I found <statusbarpanel > id="statusbar-progresspanel"> where I set collapsed="true" to uncover the > status bar progress meter. Then in <progressmeter id="statusbar-icon"> I set > mode="undetermined". The progress bar began spinning without much CPU usage. > So the progressbar alone doesn't seem to be the culprit. If we can find the > CPU usage in other scenario, maybe something else is contributing to it. I seem to be getting conflicting data here. I did the same on a fresh profile and CPU went up to nearly 20%. The same happened when I used DOMi to add a new progressmeter element without any eventlisteners and such connected to it as long as the mode is set to undetermined. In fact, it even reproduces in Firefox nightly for me when I do the following in browser console: var parent = window.document.getElementById("urlbar") var progress = gBrowser.ownerDocument.defaultView.document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "progressmeter"); progress.setAttribute("mode", "undetermined"); parent.appendChild(progress); Could someone confirm that last bit to make sure it's not just me? If so, then the only thing Thunderbird can do is to work around by not using undetermined mode at all..
One more observation: using html:progress takes about 1/2 of the CPU that xul:progressmeter takes when animating.
I can confirm that this still happens for me in Debian Sid, thunderbird 52.2.0 The CPU usage goes up quite a bit, actually enough to make the fans kick in. @zayne.a Can you please provide a bit more detail in how you do that? I tried to googling, without much luck.
(In reply to kwang.m.yi from comment #48) > I can confirm that this still happens for me in Debian Sid, thunderbird > 52.2.0 > The CPU usage goes up quite a bit, actually enough to make the fans kick in. > @zayne.a Can you please provide a bit more detail in how you do that? I > tried to googling, without much luck. View > Toolbars > Status Bar
(In reply to David von Oheimb from comment #44) > ... > Just set the IMAP Server Name of some account to an unreachable IP address > like 1.2.3.4 and try getting emails from there. > > This bug is apparently very low-level in the Mozilla network layer and has a > number of related bug reports touched again recently also for FF. Correct, Firefox gets the same issue. Perhaps a different bug, if the progress meter doesn't spin or your profile is different from the one Merike collected (In reply to Philip Chee from comment #41) > WAG: Just a guess. Go to about:config and set the following preferences: > layers.acceleration.disabled -> true [HWA disabled] > layers.offmainthreadcomposition.enabled -> false Note, we've seen a variety of behavior with HWA disabled or enabled. For example, in bug 1267662 HWA disabled improved performance on a Mac
Merike, on what OS did you profile? Note, from bug 781535 comment 24 (In reply to neil@parkwaycc.co.uk from comment #22) > Bug 658829 changed the way undetermined progress meters were painted on > Windows from an XBL implementation to a native implementation. Linux still > uses the XBL implementation for undetermined progress meters though. The linux side is bug 854093 - Indeterminate progress bar takes entire CPU - in Widget: Gtk
Flags: needinfo?(merikes.lists)
(In reply to Wayne Mery (:wsmwk, NI for questions) from comment #51) > Merike, on what OS did you profile? Linux.
Flags: needinfo?(merikes.lists)
I can't reproduce this using the Ubuntu Thunderbird 52.3.0 on Ubuntu 16.04
52.6.0 (64-bit) on Ubuntu 18.04. On both gnome on Xorg and gnome on Wayland the progress bar uses 100% of one of my CPUs. I know that if there is no other task a modern CPU tends to be in sleep mode most of the time (which makes the only task automatically reach 100%). But the progress bar also drains my battery in ca. 40 minutes and makes the CPU fan go haywire => it seems to be hideously inefficient.
@WaltS48: I guess I found out why this wasn't reproducible: There are 2 progress bars: * the one that is shown if the percentage of progress is known and * the one that is shown to indicate that an activity of unknown duration is in progress. Only the latter one uses 100% of one CPU. The drawback is: As soon as the network connection drops as you go mobile thunderbird's next attempt to connect to a server is likely to trigger the "activity of unknown duration" type progressbar - and to rapidly drain the accumulator if the mobile device. Perhaps the activity indicator that has the problem should be better referenced to as "throbber" as a 2nd thought....
No longer blocks: 791535
Severity: normal → major
Depends on: 854093
Summary: thunderbird progress bar activity puts CPU at 20% → thunderbird progress bar activity puts CPU at 20% - 100%
Depends on: 1507709

What hope do we have to get away from indeterminate xul:progressmeter for linux (ref comment 47) ?
... for all our dialogs. Unsure if same issue exists anywhere in calendar-land (see "see also" links)

Flags: needinfo?(geoff)
Summary: thunderbird progress bar activity puts CPU at 20% - 100% → thunderbird indeterminate xul:progressmeter progress bar activity puts CPU at 20% - 100%

xul:progressmeter was converted to html:progress. But looks like it's still reproducible at least on linux.
In scratchpad or console, do

document.getElementById("tabmail-container").appendChild(document.createElementNS("http://www.w3.org/1999/xhtml", "progress"));

... and check CPU usage. For me it goes to around 20% and stays there.

Can also reproduce on Firefox nightly. There in the Developer Tools | Console

document.getElementById("urlbar").appendChild(document.createElementNS("http://www.w3.org/1999/xhtml", "progress"));

The only difference is that there it jumps from listing Firefox to "GPU process" and back. It's still Firefox causing it.

There's only a few which are indeterminate and they're important for providing feedback to the user that something is happening. I think the best solution, if any, is to chase the toolkit people to fix their widget. FWIW I've not had a problem with this thing for years but it probably does use more CPU than necessary, about 6% of a CPU for me.

Flags: needinfo?(geoff)

Thanks for the info.

To reemphasize the big problems: a) even at modest amounts of CPU, it sucks battery life, b) at modest amounts (above 5-10%?, I forget the range) it impacts responsivesness when getting new mail, c) to make it worse we have (or at least have had) situations where the progress meter lingers, and even sometimes never goes away due to other brokenness so the CPU usage can be continuous.

(In reply to Geoff Lankow (:darktrojan) from comment #58)

... I think the best solution, if any, is to chase the toolkit people to fix their widget.

So far after 10 years in bug 854093 that hasn't worked out so well for linux. (or do we need something else?) Does someone know stransky or do we have some other friend?

On the windows side this required aceman and our friend Neil in bug 658829 (ref bug 791535 comment 19). But even there we still might have an edge case per bug 658829 comment 97.

Thunderbird 68.2.1 on Linux, I can confirm that this issue still exists, with createElementNS() as given above, and the SMTP sending progress bar from bug 742697, and the IMAP loading progress bar in the status bar when switching between folders.

15-20% CPU usage.

How can you match the generated <html:progress> tag with userChrome.css ?

I'd like to style it differently to check how the performance behaves, or hide it, but I don't know how to match it, only its parent #statusbar-progresspanel.

Workaround:

I found that disabling the indeterminate progress progress bar is not enough; the spinning throbber in the tab is also responsible for CPU usage.

I'm using the below in my Thunderbird profile folder's chrome/userChrome.css to disable both, resulting in the 15-20% CPU usage disappearing:

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");

/* nh2: Progress bar CPU usage fix. */
/* For some stupid reason we can't match the html:progress that's the first child of this container.
   See https://bugzilla.mozilla.org/show_bug.cgi?id=562977#c61
   So we can't style the progress bar so that it does doesn't get shown only when
   indeterminate (which takes the most CPU), or style it to render faster.
   So for now we hide the entire parent container, thus getting rid of the progress bar entirely.
*/
#statusbar-progresspanel {
  display: none;
}

/* nh2: Tab throbber animations also take a lot of CPU; hide them.
   Unfortunately I didn't find a way to replace them by a static image.
*/
.tab-throbber[busy] {
  display: none !important;
}
.tab-throbber[progress] {
  display: none !important;
}

This user chrome is a real battery saver! Thanks! ...and the throbber in the mouse pointer still tells me if thunderbird is busy.

If I understand this right we now have 2 things that are rendered in the same thread and that use 100% of one CPU (indicated as 50% of the CPU power of a 2-CPU-System, 20% of the CPU power of a 5-cpu-system and 12,5% of the CPU power of an 8-cpu one) if they get the chance of doing so. ...or was the progress meter a Red Herring and it was only the throbber all along?

100% of one CPU normally doesn't indicate that something is amiss: The CPU could be asleep 99% of the time and be busy 1% of the remaining time. But the battery drain throbber+progress meter and generate seems to indicate that the CPU won't sleep while there is indeterminate progress...

Gunter, you could only apply the rule for #statusbar-progresspanel and check how the CPU usage is with only the throbber spinning.

I have already tested that.

  • Only throbber: ~15-20% CPU usage
  • Only progress bar: ~15-20% CPU usage
  • Both throbber and progress bar: ~15-20% CPU usage
  • Both disabled: no CPU usage

@Gunter: I measured CPU usage on Linux with htop, where the percentage is always relative to 1 core. 15% means 15% of 1 core. Using full 2 cores would show up as 200%.

100% of one CPU normally doesn't indicate that something is amiss: The CPU could be asleep 99% of the time and be busy 1% of the remaining time.

I don't understand this sentence. If the CPU is asleep 99% of the time, CPU usage in htop should show up as roughly 1%, not 100%.

(In reply to Niklas Hambüchen from comment #65)

I have already tested that.

  • Only throbber: ~15-20% CPU usage
  • Only progress bar: ~15-20% CPU usage
  • Both throbber and progress bar: ~15-20% CPU usage
  • Both disabled: no CPU usage

Strange that both together use the same CPU like when only one is active.

Please could you try

.tab-throbber[busy] {
  list-style-image: none !important;
}

Then I can see if the animated PNG is the cause of the CPU usage.

Yes, list-style-image: none !important; also fixes it.

Strange that both together use the same CPU like when only one is active.

I don't find that strange: Using either progress bar or animated PNG throbber, the screen now has to be drawn at many frames per second. Once you have to redraw, redrawing a bit more doesn't make a big difference.

Separetely: Also useful to know for posterity, the upgrade from Thunderbird 60 to 68 made the indeterminate progress bar a lot more jumpy (it looks like around 10 FPS while the original was much smoother) - but to my surprise that increased jumpiness still didn't reduce CPU usage a lot.

Richard, given the most recent bug comments, is a Thunderbird solution possible without addressing bug 854093?

Flags: needinfo?(richard.marti)

I really wonder why even after 11+ years this is still not fixed and
reporters like me have been bugged multiple times with needless Needinfo requests?!?

As I wrote several times over several years at several places in this bug tracker:
The problem is easily reproducible with any TB version (meanwhile including 78.4.2.).

Again: just enter an IP address such as 1.2.3.4 as the server name/address.
Then try fetching emails. Until this timeouts,
the progress bar moves forth and back with significant CPU load (10% of one core on my current Linux machine).

In TB 78 we use now the HTML progressmeter. I hope this helps a bit.
I tried the FX approach with using a SVG as throbber but I see on my system no difference to the PNG throbber with 2% CPU.

For the throbber I could create a patch.

Flags: needinfo?(richard.marti)

In TB 78 we use now the HTML progressmeter. I hope this helps a bit.

Your hope is not fulfilled.
I've just tried TB 68 in comparison with Tb 78 - and got the same 10% CPU load on both.
Again - why don't you IT professionals try out such things yourself?!?

I'm a voluntary contributor and don't need such comments. It's also not very helpful when I see only 1% difference when I test it.

One actually does not need to be an IT professional to see that for the given issue there is no improvement with FB 78.

For the throbber I filed bug 1695950.

Depends on: 1695950
Attached patch 562977-progressmeter-statusbar.patch (obsolete) (deleted) — Splinter Review

This approach uses our colours to paint the progressmeter to also better fit with our themes. Or do you propose a different colour than --primary?

For the indeterminate state I used the approach FX is using on the download panel.

I hope this helps with the CPU usage. I can't say if it's better as for me it is still the same low value.

Assignee: nobody → richard.marti
Status: NEW → ASSIGNED
Attachment #9223784 - Flags: review?(alessandro)
Comment on attachment 9223784 [details] [diff] [review] 562977-progressmeter-statusbar.patch Review of attachment 9223784 [details] [diff] [review]: ----------------------------------------------------------------- I tested this on my slow mac and the CPU usage spikes up to 60%, with or without this patch. Nonetheless, the UI changes to the progress bar are welcome as it brings consistency to the interface. I'm not sure I like the current style of the progress bar. The height is a bit too tall and the border + bg color + animation + progress color makes this little widget look a bit busy and over styled. What do you think about: - 4px height - 2px border radius - no border color I'll see if I have any capacity later this week to investigate this and see if I can find how to prevent the spike in CPU usage.
Attachment #9223784 - Flags: review?(alessandro) → feedback+

This patch implements your wishes.

I hope you have some cycles to check where the high CPU load comes from.

Attachment #9223784 - Attachment is obsolete: true
Attachment #9225034 - Flags: review?(alessandro)
Comment on attachment 9225034 [details] [diff] [review] 562977-progressmeter-statusbar.patch Review of attachment 9225034 [details] [diff] [review]: ----------------------------------------------------------------- Looks good, thanks. Let's leave this open so I can later take it and investigate the performance issue. ::: mail/themes/shared/mail/folderProps.css @@ +25,1 @@ > overflow: hidden; little nit: this could benefit from a `vertical-align: middle` in the folder props dialog, because the default value from toolkit is `-0.2em`, for whatever reason.
Attachment #9225034 - Flags: review?(alessandro) → review+
Target Milestone: --- → 91 Branch
Attached image folderprops-align.png (deleted) —

(In reply to Alessandro Castellani [:aleca] from comment #78)

little nit: this could benefit from a vertical-align: middle in the folder
props dialog, because the default value from toolkit is -0.2em, for
whatever reason.

I leaved it like it is. With vertical-align: middle it is too low, see screenshot, at least with normal scaling.

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/fb607a0fb095
Make the progressmeter use the theme colors. r=aleca

(In reply to Alessandro Castellani [:aleca] from comment #78)

...
Let's leave this open so I can later take it and investigate the performance issue.

Is there a solution? Or should this be delegated to someone else?

Flags: needinfo?(alessandro)

This slipped between other bugs, thanks for the ping.

I'm not sure there's anything else to do here as I can't reproduce this issue anymore.
Tested on 91.5.1 and on my mac the usage remains around 5% without spiking anymore.
Also, if I'm not wrong, this is not a XUL element anymore but it's not a standard HTML progressbar.

Can anyone else still reproduce it?

Flags: needinfo?(alessandro)
Severity: major → S4

I'll close the bug as we can't reproduce it.

Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → WONTFIX

(In reply to Richard Marti (:Paenglab) from comment #83)

I'll close the bug as we can't reproduce it.

Rather than Wontfix, it seems to me we should use WORKSFORME (for not reproducible using the STR) or Fixed via comment 80.

Resolution: WONTFIX → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: