Open Bug 1707966 Opened 4 years ago Updated 2 years ago

Some JS function call seems to be faster in Chrome when loading facebook.com/groups/theboardgamegroup

Categories

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

defect

Tracking

()

People

(Reporter: sefeng, Unassigned)

References

(Blocks 1 open bug, )

Details

(Whiteboard: [sp3])

Firefox profile: https://share.firefox.dev/2QEAGUx
Chrome profile: https://share.firefox.dev/32PbLjM , original JSON: https://drive.google.com/file/d/1rw4aeWym-Zvd4EJ6q100JKaU95hRo0Y8/view?usp=sharing

There's a function called V in both profiles, which generally took about 5ms to 10ms in Chrome and sometimes 20-30ms. And it took about 15-30ms in Firefox, even there was one took 197ms, the majority of this 197ms was HTMLCanvasElement.getContext.

Summary: Some JS function call seems to be faster in Chrome → Some JS function call seems to be faster in Chrome when loading facebook.com/groups/theboardgamegroup

A couple of interesting things going on here.

  1. There's a slow call (200ms of jank) into HTMLCanvasElement.getContext, which is DOM code, not JS.
  2. The hottest JS code is the minified function uh. Here's the code:
function uh(d, c, e, f, g, h) {
    qh = h;
    N = c;
    c.memoizedState = null;
    c.updateQueue = null;
    c.lanes = 0;
    oh.current = null === d || null === d.memoizedState ? Wh : Xh;
    h = e(f, g);
    if (sh) {
        var i = 0;
        do {
            sh = !1;
            if (!(25 > i)) throw Error(x(301));
            i += 1;
            P = O = null;
            c.updateQueue = null;
            oh.current = Yh;
            h = e(f, g)
        } while (sh)
    }
    oh.current = Vh;
    c = null !== O && null !== O.next;
    qh = 0;
    P = O = N = null;
    rh = !1;
    if (c) throw Error(x(300));
    v && null !== d && !R && (d = d.dependencies, null !== d && ng(d) && (R = !0));
    return h
}

I believe it corresponds to renderWithHooks.

Severity: -- → S3
Priority: -- → P3
Whiteboard: [sp3]
You need to log in before you can comment on or make changes to this bug.