Demo at https://codepen.io/DonKarlssonSan/pen/yLXEmob is slower in Nightly compared to Chrome. All the time is spent in JS
Categories
(Core :: JavaScript Engine: JIT, task, P3)
Tracking
()
People
(Reporter: mayankleoboy1, Unassigned)
References
(Blocks 1 open bug, )
Details
Attachments
(1 file)
(deleted),
text/html
|
Details |
Go to https://codepen.io/DonKarlssonSan/pen/yLXEmob
Click on the demo
ER: the demo draws/refreshes quickly
AR: It is slow
Chrome is faster here.
Profile: https://share.firefox.dev/3kJ5kIH
The above profile suggests almost all the time is spent in JS.
Comment 1•3 years ago
|
||
Took a quick look. We spend most of our time in intersectsWithAnother
, which calls intersectsWith
in a loop. We don't inline intersectsWith
because it is too big (215 ops; our limit is currently 130). If I strip out all the browser-specific code and run the rectangle-creation in the shell, then increasing the inlining limit roughly doubles the speed, because it lets us hoist some bounds-checking code out of the loop. This doesn't seem to have an effect in the browser, though. I think that's because codepen edits loops to add calls to window.CP.shouldStopExecution
(which detects infinite loops). The call to shouldStopExecution
is opaque to the optimizer and similarly prevents hoisting.
This is interesting, although I don't immediately see an easy fix.
Reporter | ||
Updated•3 years ago
|
Updated•2 years ago
|
Reporter | ||
Comment 2•2 years ago
|
||
Description
•