Closed Bug 676939 Opened 14 years ago Closed 2 years ago

Reuse compiled scripts across pages

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect

Tracking

()

RESOLVED DUPLICATE of bug 1670403

People

(Reporter: jrmuizel, Unassigned)

Details

I was looking in about:memory and saw 13MB for mjit code for tbpl.mozilla.org. I expect this was because I had a lot of tbpl tabs open. It would be nice if these tabs could share what's likely the same mjit code. I talked with shaver and he had some idea about how this might be possible.
We share jitted code within a compartment so, assuming all your tbpl.mozilla.org tabs are being properly put in the same compartment (which it sounds like they are), then we should be reusing those compiled scripts. A separate question is why tbpl generates 13MB of mjit code.
Oh wait, I'm totally wrong. Each of those pages will compile its own copy of the JSScript so while compartment-per-domain doesn't *prevent* sharing code, we aren't.
So the biggest issue I ran into last time I looked at this stuff was COMPILE_N_GO...
I don't know much about this stuff. But if COMPILE_N_GO is an issue, then I assume the tabs have different global objects. And if that's the case, then pretty soon all these scripts will be in different compartments (when we have compartment-per-global). And that will make this a lot harder.
Yes, the tabs very much have different global objects.
Assignee: general → nobody
Severity: normal → S3

Sharing compiled scripts has become more complicated because of Electrolysis and Fission.

Current efforts revolve around sharing Stencils; see stencil-nav bug.

Status: NEW → RESOLVED
Closed: 2 years ago
Duplicate of bug: stencil-nav
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.