Closed Bug 1288563 Opened 6 years ago Closed 2 years ago
chromium source code indexer is very slow in Gecko
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/dom/Node.cpp?l=2236 as an example. All the time is spent in reflow which is usually triggered by .offsetTop.
I tested in Firefox 48 and 50, and I didn't see significant slowness in the page you mentioned. What operation did you do makes you feel slow? Did you test that with safe mode or a clean profile?
Loading that page is super slow. It seems to be the left sidebar takes time, I think. https://cleopatra.io/#report=77477e58d6176b2150774a51db19277aa1ef3ab2
Hmmm, it doesn't seem I can reproduce this issue locally on Mac. I saw offsetTop triggers some flush, but the majority of that is just restyling. Did you reproduce this with a clean profile? I wouldn't be surprised if there is any addon which touches the tree frequently and consequently causes lots of additional reflow. Also ni?dholbert as large part of the layout in the profiling report involves flexbox, so probably there is something we can improve in general?
I can reproduce this issue with nightly and linux. Clean profile.
I guess the reason here is that we do much more reflow than necessary. There are two nested flexbox wrapping the source code, and it seems we reflow content of every flexbox twice (which seems to be another vulnerable O(2^n) performance issue), so nestedly, we reflow the source code 4times every time we flush the layout. Lots of reflow seems to be avoidable because both flexboxs seem to have only one child with non-constant width. I guess we should be able to only reflow everything in one pass, and check if the child with variable width needs to be reflowed with a different width again. (I'm not familiar with flexbox, though, so I could be missing something.)
(In reply to Olli Pettay [:smaug] (vacation Apr 15-20) from comment #0) > https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/dom/Node.cpp?l=2236 > as an example. This now triggers "Could not resolve path src/third_party/WebKit/Source/core/dom/Node.cpp", but here's another long source file, in a directory with lots of contents, to stress-test this: https://cs.chromium.org/chromium/src/third_party/sqlite/sqlite-src-3220000/src/expr.c Here are two profiles that I captured of this pageload in today's Nightly (filtered for nsFlexContainerFrame) https://perfht.ml/2JbXbqB (404ms total in nsFlexContainerFrame) https://perfht.ml/2qK1P8q (670ms total in nsFlexContainerFrame) In both cases, around 40% of that time in in a single long reflow, and the rest is from a series of short (mostly script-triggered) reflows.
Flags: needinfo?(dholbert) → needinfo?(bugs)
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.