Last Comment Bug 683952 - jump to anchor freezes Fx for about 15 s in 500 K data
: jump to anchor freezes Fx for about 15 s in 500 K data
Status: RESOLVED FIXED
: regression, testcase
Product: Core
Classification: Components
Component: Layout (show other bugs)
: Trunk
: All All
: P2 normal (vote)
: mozilla9
Assigned To: Boris Zbarsky [:bz]
:
Mentors:
Depends on: 682052
Blocks: 66619
  Show dependency treegraph
 
Reported: 2011-09-01 10:31 PDT by Stefan
Modified: 2011-09-08 10:23 PDT (History)
12 users (show)
bzbarsky: in‑testsuite?
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Testcase version 0 (500.01 KB, text/html)
2011-09-01 10:33 PDT, Stefan
no flags Details
Speed up iterating over the continuations of the frame when scrolling to it. (10.31 KB, patch)
2011-09-02 12:05 PDT, Boris Zbarsky [:bz]
roc: review+
Details | Diff | Splinter Review

Description Stefan 2011-09-01 10:31:57 PDT
User Agent:  

Steps to reproduce:

1. Open testcase, allow to finish loading (jumps to the end).
2. Click at "click and wait 1"


Actual results:

2. Fx freezes for about 15 s


Expected results:

Jumps to anchor immediately. No freeze.
Comment 1 Stefan 2011-09-01 10:33:19 PDT
Created attachment 557562 [details]
Testcase version 0
Comment 2 Stefan 2011-09-01 10:34:49 PDT
good 2.0.0.19
bad  3.0.19
Comment 4 Boris Zbarsky [:bz] 2011-09-02 11:01:23 PDT
Stefan, thanks for the testcase!

So the issue here is that we spend 85% of our time constructing line iterators (which involves two walks over the line list: once to count the lines and once to stick them in the array) and then 15% more finding the line containing a given frame.

The reason the construction takes so long is that the <a name="xX"> contains all the text on the page.  So when we do the walk over continuations in PresShell::DoScrollContentIntoView we end up calling AccumulateFrameBounds 10498 times.  And each call constructs a line iterator for a block that has 14815 lines.

I can make this part faster, but the FindLineContaining cost will still be there, of course.  That's bug 682052.
Comment 5 Stefan 2011-09-02 11:19:16 PDT
(In reply to Boris Zbarsky (:bz) from comment #4)
> The reason the construction takes so long is that the <a name="xX"> contains
> all the text on the page.  

Thanks for the hint, I forgot to close the <a> tags.

> I can make this part faster, but the FindLineContaining cost will still be
> there, of course.  That's bug 682052.

Why does it jump so fast with Fx 2?
Comment 6 Boris Zbarsky [:bz] 2011-09-02 11:23:18 PDT
Because we fixed bug 66619 since then, which involves looking at continuations; that's needed to make multi-line links scroll sanely.
Comment 7 Boris Zbarsky [:bz] 2011-09-02 12:05:20 PDT
Created attachment 557906 [details] [diff] [review]
Speed up iterating over the continuations of the frame when scrolling to it.
Comment 9 Phil Ringnalda (:philor) 2011-09-06 22:12:52 PDT
Backed out - https://tbpl.mozilla.org/?tree=Mozilla-Inbound&usebuildbot=1&rev=d01a282b5a40 should be the clearest rev to see the orange from this set, free from the leak that backout fixed.
Comment 10 Boris Zbarsky [:bz] 2011-09-07 07:02:20 PDT
This patch wasn't the problem; repushed as http://hg.mozilla.org/integration/mozilla-inbound/rev/16813bde78b9

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