WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
125619
Improve the find word boundary performance
https://bugs.webkit.org/show_bug.cgi?id=125619
Summary
Improve the find word boundary performance
KyungTae Kim
Reported
2013-12-12 00:20:17 PST
Created
attachment 219051
[details]
testcase Currently, the finding end word boundary has poor performance when the word is very wrong. If you double click on the texts in the attached file, that takes several seconds to select the word. Both startWordBoudary and endWordBoundary uses findWordBoundary that returns both start and end boundary, then use only start or end boundary. By using the separate function for finding end word boundary, the word selection performance can be improved by up to 50%.
Attachments
testcase
(110.11 KB, text/html)
2013-12-12 00:20 PST
,
KyungTae Kim
no flags
Details
Patch
(3.10 KB, patch)
2013-12-12 00:33 PST
,
KyungTae Kim
no flags
Details
Formatted Diff
Diff
Patch
(3.24 KB, patch)
2013-12-12 01:20 PST
,
KyungTae Kim
no flags
Details
Formatted Diff
Diff
Patch
(4.33 KB, patch)
2013-12-12 16:18 PST
,
KyungTae Kim
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
KyungTae Kim
Comment 1
2013-12-12 00:33:30 PST
Created
attachment 219052
[details]
Patch
Build Bot
Comment 2
2013-12-12 01:03:32 PST
Comment on
attachment 219052
[details]
Patch
Attachment 219052
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-queues.appspot.com/results/48138217
KyungTae Kim
Comment 3
2013-12-12 01:20:25 PST
Created
attachment 219057
[details]
Patch
Sam Weinig
Comment 4
2013-12-12 10:41:25 PST
Comment on
attachment 219057
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=219057&action=review
> Source/WebCore/editing/VisibleUnits.cpp:653 > +#if PLATFORM(MAC)
Please don't put platform specific changes in this platform independent file.
Darin Adler
Comment 5
2013-12-12 10:48:15 PST
It’s OK to do this by adding the new function. We should add a Mac implementation too, even if there is no performance benefit on Mac.
KyungTae Kim
Comment 6
2013-12-12 16:18:44 PST
Created
attachment 219133
[details]
Patch
Darin Adler
Comment 7
2013-12-12 17:32:31 PST
Comment on
attachment 219133
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=219133&action=review
> Source/WebCore/ChangeLog:11 > + No tests because no operation changes.
Normally we are able to build performance tests that show benefits in cases like this.
> Source/WebCore/platform/text/mac/TextBoundaries.mm:52 > +void findEndWordBoundary(const UChar* chars, int len, int position, int* end) > +{ > + NSString* string = [[NSString alloc] initWithCharactersNoCopy:const_cast<unichar*>(chars) > + length:len freeWhenDone:NO]; > + NSAttributedString* attr = [[NSAttributedString alloc] initWithString:string]; > + NSRange range = [attr doubleClickAtIndex:(position >= len) ? len - 1 : position]; > + [attr release]; > + [string release]; > + *end = range.location + range.length; > +}
Looks fine. Or we could just have this call findWordBoundary.
WebKit Commit Bot
Comment 8
2013-12-12 20:56:38 PST
Comment on
attachment 219133
[details]
Patch Clearing flags on attachment: 219133 Committed
r160526
: <
http://trac.webkit.org/changeset/160526
>
WebKit Commit Bot
Comment 9
2013-12-12 20:56:41 PST
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug