Nightly is 3.25x slower than Chrome to paste text on https://quilljs.com/playground/snow
Categories
(Core :: JavaScript Engine, task, P2)
Tracking
()
People
(Reporter: mayankleoboy1, Unassigned)
References
(Blocks 1 open bug, )
Details
Attachments
(1 file)
|
176.05 KB,
text/plain
|
Details |
Go to https://quilljs.com/playground/snow
Copy-paste the attached sample text.
Nightly: https://share.firefox.dev/4hHeMqV (26s)
Chrome: https://share.firefox.dev/41nuRwc (8s)
Comment 1•1 year ago
|
||
A very large chunk of this is Ion JIT code for the uA function and it's a little surprising we're that much slower. I'll take a quick look.
Comment 2•1 year ago
|
||
Mayank, are you sure those numbers are right? Can you reproduce that also without the profiler?
What I see here on Mac is ~8 seconds in Chrome, ~14 seconds in Nightly. Slower but not 3x slower.
| Reporter | ||
Updated•1 year ago
|
| Reporter | ||
Comment 3•1 year ago
|
||
This is what i get on a frehs profile : https://share.firefox.dev/4k152JL
I also timed it using a stopwatch and disabling the profiler and got roughly the same 20s.
Comment 4•1 year ago
|
||
I looked at the code Ion generates for this uA function and we generate fairly decent code for most of the hot blocks - I didn't see any obvious low hanging fruit. Some of these blocks are executed > 1.8 billion times so small codegen issues might have a larger effect than you'd normally expect. This function also seems to walk a large tree or graph of JS objects so some of the overhead might be from cache misses.
function uA(e) {
e: for (;;) {
for (; null === e.sibling;) {
if (null === e.return || u$(e.return)) return null;
e = e.return
}
for (e.sibling.return = e.return, e = e.sibling; 5 !== e.tag && 6 !== e.tag && 18 !== e.tag;) {
if (2 & e.flags || null === e.child || 4 === e.tag) continue e;
e.child.return = e, e = e.child
}
if (!(2 & e.flags)) return e.stateNode
}
}
Comment 5•1 year ago
|
||
Jan, is the uA function manipulating DOM elements? Maybe this bug is a hint to look at DOM field access.
Comment 6•1 year ago
|
||
Looking at the profile, we're spending 97% of our time in uA itself, not in anything it calls. So I think it's unlikely that it's touching DOM elements.
| Reporter | ||
Comment 7•1 year ago
|
||
Not sure what changed, but this takes 2s on nightly: https://share.firefox.dev/41sgUwV .
Chrome takes 300ms, but now the hotspots are in editor/Focus/Mutation thingies, for which numerous bugs already exist.
CAlling this WFM.
Comment 8•1 year ago
|
||
Looks like the webpage was rewritten; the script containing the slow uA function (https://quilljs.com/_next/static/chunks/framework-98741467467a0898.js) doesn't show up anywhere in the latest profile.
Description
•