Closed
Bug 1200483
Opened 9 years ago
Closed 9 years ago
Performance issue for DXR context menu
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
RESOLVED
WORKSFORME
Tracking | Status | |
---|---|---|
firefox43 | --- | affected |
People
(Reporter: xidorn, Unassigned)
Details
When viewing a huge cpp source file (e.g. nsCSSFrameConstructor.cpp) in DXR, if you click any identifier, you would notice an annoying lag.
According to the info from performance tools, that is mainly because of two long layout, the first is triggered by getting `window.scrollY`, the second is triggered by some element`.focus()`.
Visually the script does two things:
1. hightlight all matches of the identifier
2. show/hide the context menu
None of them should triggers layout for the whole page as far as I see.
Comment 1•9 years ago
|
||
> 1. hightlight all matches of the identifier
Is this done by modifying the DOM?
Reporter | ||
Comment 2•9 years ago
|
||
Hmm, good catch. It seems they do that via wrapping nodes with <mark> tag. [1] I thought they should use class or attribute...
[1] https://github.com/mozilla/dxr/blob/16c97e2a3697ea700b361a09b9841478049ab148/dxr/static/js/context_menu.js#L17
Reporter | ||
Comment 3•9 years ago
|
||
But Blink performs much better than ours on that case. It takes only ~50ms for that layout, while ours takes >1s in total.
Comment 4•9 years ago
|
||
Sure. So we need to profile.
Reporter | ||
Comment 5•9 years ago
|
||
Comment 6•9 years ago
|
||
Hmm. I'm seeing a lot of table reflow in that profile...
Reporter | ||
Comment 7•9 years ago
|
||
From the profile, it seems there are two parts which takes the most of the time:
* the reconstruction of the table (~14% in reconstruction + ~16% in reflow)
* reflow of float elements. Roughly ~40% of the time is spent on the single function nsFloatManager::GetFlowArea(), within which half happens before the reconstruction, and half after.
It seems in DXR, every line of code is a float element, which may be one of the main reason of the slowness.
Reporter | ||
Comment 8•9 years ago
|
||
It seems this is no longer a big issue on Nightly. Probably has been fixed by some other bugs. Close with WORKSFORME.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•