Open Bug 1649578 Opened 4 years ago Updated 3 years ago

Replace Timer.jsm with native setTimeout/setInterval methods on the JSM global

Categories

(Core :: XPConnect, task, P3)

task

Tracking

()

People

(Reporter: kmag, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: fission-memory)

Timer.jsm uses much more memory in content processes than native implementations would.

Severity: -- → N/A
Status: NEW → ASSIGNED
Fission Milestone: --- → M7
Assignee: kmaglione+bmo → nobody
Status: ASSIGNED → NEW
Whiteboard: fission-memory

Not essential for Fission Beta, should get triaged for correct priority with other memshrink work. Below is some context from kmag's conversation on matrix.
kmag: It'll be a few KB. It's unfortunately just a bit messy to implement. None if the existing timer stuff is easily reusable and adding globals to JSM scopes is... not trivial at this point
There is a much quicker short-term version where we'd keep Timer.jsm but have it export a native API like I did for Services.jsm, though. That'd probably take about half the time. Maybe less. So I may do it.
But we'd save a bunch of additional memory from removing the code that imports Timer.jsm. There's a bunch of it, and it adds up quickly. And it's pretty hard to quantify until you actually remove it. I tend to just see huge surprise memory improvements when I do those sorts of refactorings.

Fission Milestone: M7 → ---
Priority: -- → P3
Fission Milestone: --- → Future

This is a memshrink bug, not a Fission bug.

Fission Milestone: Future → ---
You need to log in before you can comment on or make changes to this bug.