High CPU usage on translation view

RESOLVED FIXED

Status

P3
normal
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: tchevalier, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

STR:
- Open the translation view for any string, for instance https://pontoon.mozilla.org/fr/engagement/snippets/2016/nov2016.lang/?string=159173
- Keep the focus on this tab (i.e. do not switch tab) and do nothing in particular on the page
- Wait for a minute or two

Actual results:
My MBP fan is going crazy and my battery is drained much faster than usual. If I switch tab or close the tab, everything goes back to normal.
Could it be an infinite loop in a script or similar?

Happy to help if you can’t reproduce or need data from a profiler, etc. It’s not a recent regression, already noticed in the past.
I'm unable to reproduce this locally or on production instance.

Could you provide some more data, e.g. the CPU usage chart and profiler data?

Does it also happen on other views, like /teams?
Created attachment 8817738 [details]
Perf profile from the translate view
I've identified a possible candidate for this issue: loading animations in History, Machinery, and Locales tabs persist even when tab contents finishes loading.

Loading animations are implemented using CSS animations via Font Awesome. We should either use display:none instead of visibility:hidden and/or add/remove the fa-spin class as it's needed.

I'll dig into it and test if it affects the profile chart.
Priority: -- → P3
I've deployed the animations fix on stage.

Théo, could you please check it out, e.g. here?
https://mozilla-pontoon-staging.herokuapp.com/sl/engagement/snippets/2014/apr2014.lang/?string=143644
Flags: needinfo?(theo)
:mathjazz

I've noticed this issue a while ago but for some reason I didn't mark this as the major bottle-neck on slower systems.
Your patch definetely helps because I don't see any unecessary css-related activities. But I can't estimate if that will be enough in Theo's case.
(In reply to Matjaz Horvat [:mathjazz] from comment #5)
> I've deployed the animations fix on stage.
> 
> Théo, could you please check it out, e.g. here?
> https://mozilla-pontoon-staging.herokuapp.com/sl/engagement/snippets/2014/
> apr2014.lang/?string=143644

It seem to fix the issue \o/

When I open prod and click on a bunch of strings to trigger the animation, laptop is heating. Then I open a new tab with staging, do the same, and a couple minutes after that, laptop cools down and fan stops.
Flags: needinfo?(theo)

Comment 8

2 years ago
Commit pushed to master at https://github.com/mozilla/pontoon

https://github.com/mozilla/pontoon/commit/a39fd3d2077b2449c7f9e0687767c271d1682994
Fix bug 1312228: Stop tab loading animations when not needed

Also prevents high CPU usage

Updated

2 years ago
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.