Closed Bug 1667868 Opened 5 years ago Closed 5 years ago

Interacting with specific element of the PDSP Ki database search form freezes Firefox

Categories

(Firefox :: Untriaged, defect)

Firefox 81
defect

Tracking

()

RESOLVED FIXED
83 Branch
Tracking Status
firefox81 --- wontfix
firefox82 --- wontfix
firefox83 --- fixed

People

(Reporter: aerkiaga3, Assigned: emilio)

References

(Blocks 1 open bug)

Details

(Keywords: perf)

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:81.0) Gecko/20100101 Firefox/81.0

Steps to reproduce:

  1. Go to https://pdsp.unc.edu/databases/pdsp.php
  2. Check 'Test Ligand'
  3. Click the dropdown button at the right of that field

Actual results:

Firefox freezes after a few seconds, the 'MainThread' process at a constant 1 full core CPU usage.

Expected results:

After a quite noticeable but short time interval, a very long dropdown list should have appeared, listing all test ligands for which data exists in the database.

The User Agent listed above corresponds to the browser version and operating system this bug was successfully reproduced on.

Confirmed with Nightly 83 on Linux.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: perf

https://share.firefox.dev/2S7iYGi hopefully shows the problem.

Emilio, want to have a look? This is spinning in https://searchfox.org/mozilla-central/source/toolkit/actors/SelectChild.jsm#379.

Flags: needinfo?(emilio)

(In reply to Paul Adenot (:padenot) from comment #3)

https://share.firefox.dev/2S7iYGi hopefully shows the problem.

Emilio, want to have a look? This is spinning in https://searchfox.org/mozilla-central/source/toolkit/actors/SelectChild.jsm#379.

Thanks for the profile! I think the issue is rather in the parent process: https://share.firefox.dev/3n3ZIbh

Both could be improved. I can look.

Assignee: nobody → emilio

Same idea, when only one node is slotted or unslotted, we only need to
do work for the rest of assigned nodes iff the slot has dir=auto or a
dir=auto ancestor, and the result of computing the dir=auto ancestor
changes.

Otherwise we just need to propagate the directionality from the slot.

Depends on D91753

Well looking a bit closer, the improvements in the child process are probably a bit minor (micro-optimizing font-family serialization and so on), so probably worth doing in a separate bug.

Flags: needinfo?(emilio)
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/62a557bcdc10 Optimize slotting for appends to a shadow host. r=smaug https://hg.mozilla.org/integration/autoland/rev/d062c1f7777b Optimize directionality change handling during slotting. r=smaug

It would be nice to see a profile of the same thing with a build including the patches that have landed.

Here is a profile after the patch, it's significantly improved but it is still slow for me https://share.firefox.dev/3l6zJ0P

(In reply to Pascal Chevrel:pascalc from comment #12)

Here is a profile after the patch, it's significantly improved but it is still slow for me https://share.firefox.dev/3l6zJ0P

Thanks Pascal!

Emilio, is there anything in this profile that's actionable and would be worth a follow-up bug?

Flags: needinfo?(emilio)

Yes, I think there are multiple things that could be improved:

  • Half of the parent process time is running JS (custom element constructors, etc) which probably could do less work.
  • Almost other half (60% of the remaining layout time) comes from nsTextBoxFrame::DoXULLayout... Chances are than moving this to something that isn't XUL would massively speed it up, it's not like there's so much text there...

So yeah, let's file a follow-up bug IMO.

Flags: needinfo?(emilio)
Blocks: 1669228
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: