DOM_SCRIPT_OFF_THREAD_DECODE_EXEC cannot be compared against DOM_SCRIPT_OFF_THREAD_PARSE_EXEC

RESOLVED FIXED in Firefox 56

Status

()

RESOLVED FIXED
a year ago
a year ago

People

(Reporter: nbp, Assigned: nbp)

Tracking

unspecified
mozilla56
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox56 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

a year ago
Currently we use a simple heuristic based on the size of the script / encoded content to decide whether we should parse/decode off-main thread.

Unfortunately, we have no way to ensure that we can safely compare both.  Based on density of the script size about 1024 bytes, and the density of encoded content (assuming that the encoding size is proportional to the source length, which it is not).  We can deduce that the size factor is 3.67, which roughly corresponds to what is observed with the low and max bounds of sizes.

Based on this factor, this implies that
  P(decode_MT  | parse_MT) = 64.36%
  P(decode_OMT | parse_MT) = 35.64%

  P(parse_MT  | decode_OMT) = 55.37%
  P(parse_OMT | decode_OMT) = 44.63%

If we were to change the heuristics of CanCompileOffThread to include this 3.67 factor inside this heuristics (for telemetry reasons), then we would almost have a 1-to-1 mapping between scripts which are parsed and decoded on the main thread, and the script which are parsed and decoded off-main-thread.  Thus obtaining something closer to:
  P(decode_MT  | parse_MT) = ~100%
  P(parse_OMT | decode_OMT) = ~100%

This might not be the ideal solution, but this would at least give us some data on whether the JSBC is improving or not.
(Assignee)

Comment 1

a year ago
Created attachment 8887552 [details] [diff] [review]
Hard-code the current size factor between the source size and the bytecode size.
Attachment #8887552 - Flags: review?(mrbkap)
(Assignee)

Comment 2

a year ago
Created attachment 8887553 [details] [diff] [review]
Hard-code the current size factor between the source size and the bytecode size.
Attachment #8887553 - Flags: review?(mrbkap)
(Assignee)

Updated

a year ago
Attachment #8887552 - Attachment is obsolete: true
Attachment #8887552 - Flags: review?(mrbkap)
Attachment #8887553 - Flags: review?(mrbkap) → review+
(Assignee)

Updated

a year ago
Keywords: checkin-needed

Comment 3

a year ago
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b268982e5a34
Hard-code the current size factor between the source size and the bytecode size. r=mrbkap
Keywords: checkin-needed

Comment 4

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/b268982e5a34
Status: ASSIGNED → RESOLVED
Last Resolved: a year ago
status-firefox56: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.