Closed Bug 1375631 Opened 7 years ago Closed 4 years ago

Netflix browse triggers long IonBuilder compiles

Categories

(Core :: JavaScript Engine: JIT, defect, P2)

defect

Tracking

()

RESOLVED INVALID
Performance Impact medium
Tracking Status
platform-rel --- ?

People

(Reporter: tcampbell, Assigned: tcampbell)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [platform-rel-netflix])

I see 200-500ms calls to IonBuilder when scrolling netflix.

STR:
- Start profiler
- Navigate to netflix.com/browse (logged in with cookies)
- Immediately scroll to bottom -> top -> bottom
- Look at profile

Profile: http://bit.ly/2sW4Zb9
Looking at function |b| from the profile, I see we abort due to loopRestart limit and just throw away the 100's of ms of work. When it fails there are 2500+ basic blocks in worklist. The MIR graph has allocated 25k basic blocks and 300k MIR nodes at this point.
The loopRestart trick is made to re-compute the MIR when we cannot merge the type information from the back-edge of a loop back into the loop entry block. Which makes us discard the code, and try again.

The reason we have this trick is due to the fact that the MIR generation is currently responsible for querying the type information.

If we were to not loop back, then we should distinguish 2 cases:
 - Large type sets at the back-edge: We should add guards to filter out type-sets.
 - Smaller type sets at back-edge: We can optimize the MIR nodes better.

If we were to separate the Type Inference from the MIR generation, maybe have a MJSOp (MIR node mirroring a JS opcode).  Then we could buffer all the MIR nodes to be inserted based on the type specialization, and as a replacement of the MJSOp.

Another option might be to query all type information without the MIR Graph, and generate the MIR on another thread, based on the constraints collected by querying the Type inference on the main thread.
Depends on: 1382844
Priority: -- → P2
platform-rel: --- → ?
Whiteboard: [platform-rel-netflix]
Blocks: 1488435
Whiteboard: [platform-rel-netflix] → [platform-rel-netflix][qf:p1:f64]
It looks like the best plan is to set the IonBuilder loop restart failure threshold to be based on number of basic blocks instead of number of restarts. We can also consider factor in number of slots.

This should be a reasonable spot fix for F64.
Assignee: nobody → tcampbell
Blocks: 1490847
Status: NEW → ASSIGNED
Whiteboard: [platform-rel-netflix][qf:p1:f64] → [platform-rel-netflix][qf:p2]
See Also: → 1536006

Fixed by WarpBuilder.

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → INVALID
Performance Impact: --- → P2
Whiteboard: [platform-rel-netflix][qf:p2] → [platform-rel-netflix]
You need to log in before you can comment on or make changes to this bug.