Bug 13682 - REGRESSION (r21270): Selection and Find are very slow
Summary: REGRESSION (r21270): Selection and Find are very slow
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.4
: P1 Major
Assignee: Nobody
URL: http://www.w3.org/TR/2003/REC-DOM-Lev...
Keywords: InRadar, Regression
Depends on:
Blocks:
 
Reported: 2007-05-11 15:00 PDT by mitz
Modified: 2007-05-25 00:17 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2007-05-11 15:00:21 PDT
Selection and Find performance has regressed significantly. For example, go to the URL and try to drag to select the text "The text contained within the option element" or do a Find and Find Next for the string "option".

I am going to try to narrow down the regression window.
Comment 1 Justin Garcia 2007-05-11 15:09:40 PDT
Brady narrowed this down to r21270.  Here's some discussion from the radar (<rdar://problem/5193416> REGRESSION: Selection on large pages extremely slow):

5/10/07 12:10 PM Justin Garcia:
Looks like most of the time is being spent in currentTextBreakLocaleID() from TextBreakIteratorInternalCUMac.mm.  Here's a comment from that function:

// NOTE: this abviously could be fairly expensive to do.  If it turns out to be a bottleneck, it might
// help to instead put a call in the iteratory initializer to set the current text break locale.  Unfortunately,
// we can not cache it across calls to our API since the result can change without our knowing (AFAIK
// there are no notifiers for AppleTextBreakLocale and/or AppleLanguages changes).

5/10/07 12:16 PM Justin Garcia:
Strangely though, it doesn't look like calling currentTextBreakLocalID() every time we need to find the next sentence boundary was new in Steve's patch.

5/10/07 12:36 PM Justin Garcia:
Since we called currentTextBreakLocalID() under the same circumstances before Steve's patch, and since his patch didn't appear to change that function, I would guess that the regression happened in r21222, when we started passing the grammar checking code sentence sized chunks in respondToChangedSelection.  We could conditionals the creation of those sentence sized selections on editor()->isGrammarCheckingEnabled(), but then we'd still have to deal with the regression on Leopard.
Comment 2 Brady Eidson 2007-05-11 15:12:02 PDT
<rdar://problem/5193416>

This regressed in r21270
Comment 3 mitz 2007-05-14 05:22:44 PDT
(In reply to comment #1)
> Brady narrowed this down to r21270.
[...]
> I would guess that the regression happened in r21222, [...]

Just to clarify: r21240 is fast and r21272 is slow, so r21222 alone did not cause the regression.
Comment 4 Sam Weinig 2007-05-24 23:28:34 PDT
Mitz, did the change for http://trac.webkit.org/projects/webkit/changeset/21611 fix this for you?
Comment 5 mitz 2007-05-25 00:17:05 PDT
Yes!