humble bundle snippet causes high cpu load

RESOLVED FIXED

Status

RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: philipp, Assigned: jgruen)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

4 years ago
the current humble bundle snippet on about:home causes a rather high cpu load, even when the user hasn't interacted with it yet. 
can the content somehow be made static until a user has followed the lead to click on the content and actively plays with it?
Thanks for the report! I also see a large spike in CPU.

jgruen, any idea of how difficult this change would be?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(jgruen)
(Assignee)

Comment 2

4 years ago
Hey guys, thanks for bringing this up. The game developer did a bunch of optimization to reduce CPU overhead, but I'm seeing something similar now on about:home. Let me speak with him and see if we can't sort this out.
Flags: needinfo?(jgruen)
(Assignee)

Comment 3

4 years ago
Hey Mike, we have a fix for this on the dev server. Basically changed the code to suspend all drawing on the canvas until the user clicks. Seems to really reduce overhead. Just got it in if you want to help test it out. 

https://snippets.allizom.org/show/49/
Flags: needinfo?(mjkelly)

Comment 4

4 years ago
Flagging mkelly for this.
Flags: needinfo?(mkelly)

Updated

4 years ago
Flags: needinfo?(mjkelly)
(Assignee)

Comment 5

4 years ago
oops, got my kellys crossed
(Assignee)

Comment 6

4 years ago
So I've tested this pretty broadly on OSX, Win7, Win8, and Ubuntu. Definitely improves performance on all platforms with no evident hiccups. 

https://github.com/mozilla/snippets/pull/14
Mike, can you check and get it out there?
Confirming update has been made.
Yep, update has landed on prod, and the PR mentioned has been merged.

philipp: It may take up to 24 hours for your homepage to get the update, but if you're still seeing high CPU loads, you can force a refresh of the snippet code by:

- Opening the Web Console on about:home via Tools -> Web Developer -> Web Console
- Entering gSnippetsMap.clear() and hitting enter to run it in the web console.
- Clearing your entire cache using History -> Clear Recent History, setting the time to "Everything" checking _only_ the "Cache" box.
- Refreshing your about:home page.

Whether you wait 24 hours or you force a refresh, can you confirm if the CPU usage has dropped significantly for you? Thanks!
Flags: needinfo?(mkelly) → needinfo?(madperson)
(I'm leaving this unresolved in case we have other fixes we want to put out, will mark as resolved after a discussion tomorrow about what other fixes we want to make.)
Assignee: nobody → jgruen
(Reporter)

Comment 11

4 years ago
yes, the cpu usage has now dropped noticeably. however on an older machine it still takes 5-13% just sitting there, so there is still a bit of room for improvement.
Flags: needinfo?(madperson)
(In reply to philipp from comment #11)
> yes, the cpu usage has now dropped noticeably. however on an older machine
> it still takes 5-13% just sitting there, so there is still a bit of room for
> improvement.

Cool, thanks for confirming the improvement. :D
Great to hear. We will be linking to the gamelet in social media even after we move to other snippets on about:home, so any further improvement will be appreciated.
(Reporter)

Updated

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