RESOLVED FIXED 11460
REGRESSION (r17276): Find Previous is very slow, especially when wrapping around
https://bugs.webkit.org/show_bug.cgi?id=11460
Summary REGRESSION (r17276): Find Previous is very slow, especially when wrapping around
mitz
Reported 2006-10-30 08:34:22 PST
The Find commands have become very slow, especially Find Previous. For example, go to http://bugs.webkit.org/show_bug.cgi?id=11388 and find "Repo", then press Command-Shift-G a few times. I tracked the regression down to r17271-r17282, with r17276 being the likely cause.
Attachments
John Sullivan
Comment 1 2006-10-30 09:17:00 PST
This is in radar as <rdar://problem/4808375> It also affects Copy, among other operations.
Darin Adler
Comment 2 2006-10-30 09:18:32 PST
IRC transcript excerpt: Mitz: this is the change: http://trac.webkit.org/projects/webkit/changeset/17276 Darin: It's important not to do the work until you actually ask about a range. Darin: Code is probably is doing too much work as we iterate. Mitz: this bug reminded me of another "editing" bug Mitz: when searching for the next rendered position Mitz: if it's n positions away Mitz: it takes O(n^2)
mitz
Comment 3 2006-10-30 09:22:39 PST
(In reply to comment #2) > Mitz: this bug reminded me of another "editing" bug I was referring to bug 10735, which is disguised as an SVG bug.
Justin Garcia
Comment 4 2006-10-30 16:01:17 PST
I was creating two VisiblePositions every time TextIterator exited a node. Checked in a fix in r17449. This could still be improved: we should only create VPs when the range that they are used to create is actually asked for. That would return plainText to its original speed but leave the other users of TextIterator slower than before my change in r17276. To improve those we'll need to speed up VisiblePosition creation and/or VisiblePosition::next().
Justin Garcia
Comment 5 2006-10-30 18:11:51 PST
Darin pointed out that Find would be improved by the aforementioned change as well, since it uses ranges but only once it's found the string.
Alexey Proskuryakov
Comment 6 2006-10-30 21:50:51 PST
*** Bug 11440 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.