Closed Bug 1940386 Opened 1 year ago Closed 1 year ago

A matrix generator takes 16s to generate 2 empty 99x99 matrices. Preference "layout.spellcheckDefault: 1 (Int)" is read 2x99x99 times.

Categories

(Core :: DOM: Forms, enhancement)

enhancement

Tracking

()

RESOLVED INVALID

People

(Reporter: mayankleoboy1, Unassigned)

References

()

Details

Go to https://matrix.reshish.com/multiplication.php
set 99 as the row and column for both the matrices.
Click on "Set matrices"

Nightly: https://share.firefox.dev/4gJFuyL (16s)
Chrome: https://share.firefox.dev/420nsnu (34s)

We are faster than Chrome. But are there any obvious low-hanging fruits to pick here? If not ,I am happy to close this bug as WONTFIX.

Summary: A matrix generator takes 16s to geenrate 2 empty 99x99 matrices. Preference "layout.spellcheckDefault: 1 (Int)" is read 2x99x99 times. → A matrix generator takes 16s to generate 2 empty 99x99 matrices. Preference "layout.spellcheckDefault: 1 (Int)" is read 2x99x99 times.

If you actually create two 20x20 matrices, fill them with values, and calculate it, it takes infinite amount of time to finish (i quit after 3.5 minutes or so). Let me know if there is interest in profiles.

See Also: → 1939344

(In reply to Mayank Bansal from comment #1)

If you actually create two 20x20 matrices, fill them with values, and calculate it, it takes infinite amount of time to finish (i quit after 3.5 minutes or so). Let me know if there is interest in profiles.

If we're worse than Chrome in that scenario, then that'd be interesting to diagnose a bit (though probably in a new bug since it's likely spinning wheels elsewhere than where this bug is.) Probably good to use a smaller matrix for that hypothetical new-bug, so that we take an only-slightly-painful amount of time (not > 3.5 minutes), for convenience.

I rechecked the page, and they must have changed something because the profiles are quite different now.

To create the 99x99 matrix
Nightly: https://share.firefox.dev/3DQFn65 (8.5s) ->JS heavy profile now.
Chrome: https://share.firefox.dev/4j93BIT (10s)

To calculate, it takes less than a second now. There is a slowness when clicking on "show all solutions", which is a JS bug. I will file it separately.

Daniel, is there anything to investigate/improve in this profile? (the preference is still read 2x99x99 times)

Flags: needinfo?(dholbert)
Depends on: 1941170

(In reply to Mayank Bansal from comment #3)

To create the 99x99 matrix
Nightly: https://share.firefox.dev/3DQFn65 (8.5s) ->JS heavy profile now.

So the layout things in that profile I'm seeing are:

  • a 417ms restyle just after t=4s (which is largely frame construction)
  • a 187ms reflow just after t=7.5s

Neither of those durations seem abnormally long for a page of this size, particularly given that we're faster than Chrome on this. I'm not seeing anything out of place in those parts of the profile.

the preference [ layout.spellcheckDefault ] is still read 2x99x99 times

That in-and-of-itself is unlikely to be a problem. We're checking it when initializing the editor state, for each of the input elements, or something along those lines; and it's not supposed to be particularly expensive to read. But I did notice that we're not representing it as efficiently as we could, so I spun off bug 1941170 on improving that.

But this bug here I think "invalid" in the sense that the described behavior is not-really-a-Firefox-bug; it's the ~expected outcome from throwing this much content at a browser, and we handle it better-than-the-competition which is great.

Status: NEW → RESOLVED
Closed: 1 year ago
Flags: needinfo?(dholbert)
Resolution: --- → INVALID

Thanks Daniel for investigating!

Flags: needinfo?(mayankleoboy1)
Flags: needinfo?(mayankleoboy1)

Thanks! Yeah, the preference-read that we removed there doesn't seem to make a measurable perf difference in this case, but it was a nice thing to discover to remove some preference-reading busy-work.

You need to log in before you can comment on or make changes to this bug.