Closed Bug 1671426 Opened 6 years ago Closed 5 years ago

Analyze usage of SharedImmutableScriptData

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED

People

(Reporter: nbp, Assigned: nbp)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

SharedImmutableScriptData is used to reduce memory when after the compilation of similar script. This is expected to be used for the eval-cache, and web workers, self-hosted code and (previously?) JSM.

As we are moving toward having a CompilationStencil cache, having a SharedImmutableScriptData would only make sense for cases which are not generated out of the same source.

Thus what would be interesting is to measure the existing amount of sharing for all sources which are shared as the result of the same parser output, where this no sharing possible from an earlier cache (which might prevent the parsing time as well).

Severity: -- → N/A
Priority: -- → P1

Running the given patch in a browsing session where I visit ~30 random website all opened in multiple tabs which are alive next to each others in multiple content processes.

JS_SHARE_IMMUTABLE_DATA_AFTER_PARSE
167,835 samples, average = 19.8, sum = 3,322,211

 1 |  0  0%
 2 |#########################  136262  81%
 4 |#  5598  3%
 5 |#  4086  2%
 6 |#  2809  2%
 7 |  1918  1%
 9 |  667  0%
10 |###  16495  10%

Which implies that 81% of the scripts are loaded only once and are unique per-website.
The remaining 19% are either multiples loads of the same script or loads of different script having the same functions.

Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: