RESOLVED LATER 65377
Hidden text nodes slow down position traversing
https://bugs.webkit.org/show_bug.cgi?id=65377
Summary Hidden text nodes slow down position traversing
Yong Li
Reported 2011-07-29 08:00:01 PDT
Created attachment 102361 [details] the test case When WebKit traverses positions, it wastes CPU time on hidden text nodes. Open the test case in a WebKit browser, click the blank area on the left of the visible text, you will see the page doesn't respond for text selection any more. This is because WebKit is busy in traversing hidden text nodes. The test case doesn't exist in real world. However pages with hidden text do exist in real world, and if we fix this, we could probably boost selection performance in some cases.
Attachments
the test case (516 bytes, text/html)
2011-07-29 08:00 PDT, Yong Li
no flags
proposed patch (5.31 KB, patch)
2011-07-29 08:21 PDT, Yong Li
no flags
proposed patch again (5.34 KB, patch)
2011-07-29 08:40 PDT, Yong Li
no flags
With a test case (7.65 KB, patch)
2011-08-24 10:54 PDT, Yong Li
no flags
The patch with test case (8.45 KB, patch)
2011-08-24 11:00 PDT, Yong Li
webkit.review.bot: commit-queue-
the patch (8.55 KB, patch)
2011-08-24 12:01 PDT, Yong Li
darin: review+
darin: commit-queue-
Fix the change log (8.40 KB, patch)
2012-01-25 08:37 PST, Yong Li
no flags
Yong Li
Comment 1 2011-07-29 08:21:13 PDT
Created attachment 102364 [details] proposed patch There may be more places we can optimize in Position related code. Is it a correct approach?
WebKit Review Bot
Comment 2 2011-07-29 08:25:04 PDT
Attachment 102364 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1 Source/WebCore/editing/htmlediting.cpp:222: Declaration has space between type name and * in RenderObject *renderer [whitespace/declaration] [3] Source/WebCore/editing/htmlediting.cpp:248: Declaration has space between type name and * in RenderObject *renderer [whitespace/declaration] [3] Total errors found: 2 in 5 files If any of these errors are false positives, please file a bug against check-webkit-style.
Early Warning System Bot
Comment 3 2011-07-29 08:33:51 PDT
Comment on attachment 102364 [details] proposed patch Attachment 102364 [details] did not pass qt-ews (qt): Output: http://queues.webkit.org/results/9266519
Antonio Gomes
Comment 4 2011-07-29 08:36:41 PDT
Yong, would you have numbers to share?
Yong Li
Comment 5 2011-07-29 08:40:20 PDT
Created attachment 102367 [details] proposed patch again
Yong Li
Comment 6 2011-07-29 10:33:57 PDT
(In reply to comment #4) > Yong, would you have numbers to share? No numbers. The result is significant with the test case. Without the patch, browser freezes. With the patch, you cannot feel any slowness
Yong Li
Comment 7 2011-07-29 10:37:12 PDT
(In reply to comment #0) > Created an attachment (id=102361) [details] > the test case > > When WebKit traverses positions, it wastes CPU time on hidden text nodes. > > Open the test case in a WebKit browser, click the blank area on the left of the visible text, you will see the page doesn't respond for text selection any more. This is because WebKit is busy in traversing hidden text nodes. > > The test case doesn't exist in real world. However pages with hidden text do exist in real world, and if we fix this, we could probably boost selection performance in some cases. Correction: "click the blank area on the left of..." shouldbe "on the right of"
Darin Adler
Comment 8 2011-07-31 14:37:58 PDT
Comment on attachment 102367 [details] proposed patch again View in context: https://bugs.webkit.org/attachment.cgi?id=102367&action=review > Source/WebCore/ChangeLog:10 > + No new tests because it doesn't fix any layout issue. We have a layout test system for making performance tests that check that performance has the correct order of magnitude. These tests are in the LayoutTests/perf directory using the Magnitude object. Using that you should be able to make a test that uses giant hidden text nodes to show the massive speedup from this change.
Yong Li
Comment 9 2011-08-03 19:07:05 PDT
Comment on attachment 102367 [details] proposed patch again will write a layout test...
Yong Li
Comment 10 2011-08-24 10:54:53 PDT
Created attachment 105019 [details] With a test case
Yong Li
Comment 11 2011-08-24 10:55:20 PDT
Comment on attachment 105019 [details] With a test case forgot to add change log for layouttest
Yong Li
Comment 12 2011-08-24 11:00:55 PDT
Created attachment 105021 [details] The patch with test case
WebKit Review Bot
Comment 13 2011-08-24 11:10:56 PDT
Comment on attachment 105021 [details] The patch with test case Attachment 105021 [details] did not pass mac-ews (mac): Output: http://queues.webkit.org/results/9486175
Collabora GTK+ EWS bot
Comment 14 2011-08-24 11:22:31 PDT
Comment on attachment 105021 [details] The patch with test case Attachment 105021 [details] did not pass gtk-ews (gtk): Output: http://queues.webkit.org/results/9487204
Gyuyoung Kim
Comment 15 2011-08-24 11:34:01 PDT
Comment on attachment 105021 [details] The patch with test case Attachment 105021 [details] did not pass efl-ews (efl): Output: http://queues.webkit.org/results/9490139
Early Warning System Bot
Comment 16 2011-08-24 11:34:52 PDT
Comment on attachment 105021 [details] The patch with test case Attachment 105021 [details] did not pass qt-ews (qt): Output: http://queues.webkit.org/results/9488190
WebKit Review Bot
Comment 17 2011-08-24 11:40:20 PDT
Comment on attachment 105021 [details] The patch with test case Attachment 105021 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/9486194
Yong Li
Comment 18 2011-08-24 12:01:50 PDT
Created attachment 105035 [details] the patch
Darin Adler
Comment 19 2011-08-24 16:00:42 PDT
Comment on attachment 105035 [details] the patch View in context: https://bugs.webkit.org/attachment.cgi?id=105035&action=review > LayoutTests/ChangeLog:13 > +011-08-24 Andrew Scherkus <scherkus@chromium.org> Patch deletes the "2" here! > Source/WebCore/ChangeLog:25 > +011-08-24 Sam Weinig <sam@webkit.org> Patch deletes the "2" here!
Darin Adler
Comment 20 2011-08-24 16:16:17 PDT
Comment on attachment 105035 [details] the patch There are 8 different code changes here. There is only one test case. Does the test cover all 8 changes? Or do we need to make more test cases to make sure we cover the improvements in all 8?
Yong Li
Comment 21 2011-08-25 13:48:30 PDT
(In reply to comment #20) > (From update of attachment 105035 [details]) > There are 8 different code changes here. There is only one test case. Does the test cover all 8 changes? Or do we need to make more test cases to make sure we cover the improvements in all 8? Actually 6 of them can be tested by just manually clicking on the blank area of the page. However I cannot make DRT show the problem by using eventSender to simulate mouse events. So I ended up with using selection, which tests the other 2 changes. I'll give a further try...
Eric Seidel (no email)
Comment 22 2011-12-21 14:32:15 PST
Attachment 105035 [details] was posted by a committer and has review+, assigning to Yong Li for commit.
Yong Li
Comment 23 2012-01-25 08:37:06 PST
Created attachment 123945 [details] Fix the change log
WebKit Review Bot
Comment 24 2012-01-25 09:24:04 PST
Comment on attachment 123945 [details] Fix the change log Clearing flags on attachment: 123945 Committed r105885: <http://trac.webkit.org/changeset/105885>
WebKit Review Bot
Comment 25 2012-01-25 09:24:12 PST
All reviewed patches have been landed. Closing bug.
Yong Li
Comment 26 2012-01-25 11:00:34 PST
the patch seems obsolete and causes assertions. push this task to later
Note You need to log in before you can comment on or make changes to this bug.