Closed Bug 1814550 Opened 2 years ago Closed 2 years ago

Experiment 2 separate immutable script data table for main thread runtime and all other threads

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED
111 Branch
Tracking Status
firefox111 --- fixed

People

(Reporter: arai, Assigned: arai)

References

Details

Attachments

(2 files)

The issue in bug 1810160 and bug 1807228 yahoo-mail is that we move the bytecode de-duplication from off-thread compilation to main-thread instantiation, which increases the instantiation time and regresses the benchmark score.

Especially when the same page is loaded again and again, the immutable script data
table contains the same bytecode from previous load, and all bytecode gets de-duplicated.
The de-duplication task here is time-consuming because it needs to compare the entire bytecode if the bytecode already exists in the table.

The bytecode de-duplication has 2 purposes:

  • (a) de-duplicate bytecode for different functions/scripts within single compilation and across multiple compilations
  • (b) de-duplicate bytecode for same function/script across multiple compilations

and the (b) is problematic here.

Then, the purpose of bytecode de-duplication is purely about reducing memory consumption, and not about correctness.
which means, having small amount of duplication is acceptable, as long as it doesn't regress AWSY too much.

We can have 2 separate SharedImmutableScriptDataTable:

  • one for main thread compilation which has access to JSRuntime, and
  • one for all other compilation, which doesn't have access to JSRuntime

assuming that, if a script is compiled on the main thread in the previous load, the same script will be compiled on the main thread in the next load, and if the script is compiled off main thread, it will be compiled off main thread in the next load,
so that, (b) can be achieved even with 2 separate tables.

I'll experiment this here, to see how much AWSY regression happens with the 2 separate table.

Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/b08446bfcd74 Part 1: Use 2 separate SharedImmutableScriptDataTable instances for main-thread and all-other threads. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/602d77ebb399 Part 2: Remove BytecodeEmitter::cx. r=tcampbell
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch

I was wrong about the behavior.
Worker runtime still uses their own table.

Blocks: 1815825
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: