Open Bug 1810160 Opened 2 years ago Updated 1 year ago

De-duplicate bytecode within single compilation

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

ASSIGNED

People

(Reporter: arai, Assigned: arai)

References

(Blocks 1 open bug)

Details

Attachments

(4 obsolete files)

Single compilation unit can contain multiple duplicated bytecode especially for small function (e.g. ~3000 duplicated entries within 12000 entries in gmail JS file), and performing all de-duplication on instantiation on main thread is not optimal.

Performing compilation-local deduplication off-main-thread will:

  • reduce the task requred on main thread instantiation
  • reduce the XDR bytecode size

Now ScriptStencil to SharedImmutableScriptData is not 1:1, and ScriptStencil
holds SharedImmutableScriptDataIndex to point the SharedImmutableScriptData
inside SharedDataContainer.

SharedDataContainer is simplified to use either a single pointer or a vector.

Blocks: 1807216
Attachment #9313497 - Attachment is obsolete: true
Attachment #9313498 - Attachment is obsolete: true
Attachment #9313499 - Attachment is obsolete: true
Attachment #9313500 - Attachment is obsolete: true

bug 1814550 unblocks the JSContext removal

No longer blocks: 1807216

local bytecode de-duplication can still be valuable for reducing memory consumption and also reducing XDR data size.
we can revisit this later, maybe by conditionally applying the local de-duplication only for large file, or only to files that will be XDR encoded.
also possibly with special casing small/empty functions to represent them with static data.

Blocks: 1609486
Priority: P1 → P3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: