Bug 53649 - move-left-right.html and extend-selection-*.html are slow
Summary: move-left-right.html and extend-selection-*.html are slow
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Enhancement
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-02 17:16 PST by Ryosuke Niwa
Modified: 2011-08-10 16:55 PDT (History)
7 users (show)

See Also:


Attachments
extend-selection* profile (5.68 MB, application/octet-stream)
2011-02-02 17:19 PST, Ryosuke Niwa
no flags Details
move-left-right profile (5.82 MB, application/octet-stream)
2011-02-02 17:32 PST, Ryosuke Niwa
no flags Details
extend-selection* profile (deleted)
2011-03-11 02:08 PST, Ryosuke Niwa
no flags Details
move-left-right profile (deleted)
2011-03-11 02:08 PST, Ryosuke Niwa
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2011-02-02 17:16:51 PST
According to the bug 27995, the two slowest tests are from editing/selection.

9.58 secs: editing/selection/move-left-right.html
9.37 secs: fast/js/array-filter.html
7.71 secs: editing/selection/extend-selection.html

We should improve the performance.
Comment 1 Ryosuke Niwa 2011-02-02 17:19:25 PST
Created attachment 81009 [details]
extend-selection* profile

It seems like the most time is spent in ICU and isContentEditable.
Comment 2 Ryosuke Niwa 2011-02-02 17:32:35 PST
Created attachment 81011 [details]
move-left-right profile
Comment 3 Ryosuke Niwa 2011-02-02 17:33:09 PST
It seems like ICU and isContentEditable is hot again:

	5.6%	5.6%	libicucore.A.dylib	icu::RuleBasedBreakIterator::handleNext(icu::RBBIStateTable const*)
	0.0%	5.6%	libicucore.A.dylib	 icu::RuleBasedBreakIterator::next()
	0.0%	4.4%	libicucore.A.dylib	  icu::RuleBasedBreakIterator::previous()
	0.0%	3.1%	WebCore	   WebCore::RenderText::previousOffset(int) const
	0.0%	1.1%	WebCore	    WebCore::Position::inRenderedText() const
	0.0%	1.1%	WebCore	     WebCore::Position::isCandidate() const
	0.0%	1.1%	WebCore	    WebCore::PositionIterator::decrement()
	0.0%	1.1%	WebCore	     WebCore::Position::upstream(WebCore::EditingBoundaryCrossingRule) const
	0.0%	0.9%	WebCore	    WebCore::Position::previous(WebCore::PositionMoveType) const
	0.0%	0.9%	WebCore	     WebCore::previousVisuallyDistinctCandidate(WebCore::Position const&)
	0.0%	1.3%	libicucore.A.dylib	   icu::RuleBasedBreakIterator::following(int)
	0.0%	1.3%	WebCore	    WebCore::RenderText::nextOffset(int) const
	0.0%	0.9%	WebCore	     WebCore::Position::inRenderedText() const
	0.0%	0.4%	WebCore	     WebCore::PositionIterator::increment()
	0.0%	0.1%	WebCore	     WebCore::Position::next(WebCore::PositionMoveType) const
	0.0%	1.0%	libicucore.A.dylib	  icu::RuleBasedBreakIterator::following(int)
	0.0%	0.1%	WebCore	  WebCore::RenderText::nextOffset(int) const
	0.0%	0.1%	CoreFoundation	  CFStringTokenizerAdvanceToNextToken
	5.4%	5.4%	libobjc.A.dylib	objc_msgSend
	0.0%	1.5%	WebKit	 WebEditorClient::isEditable()
	0.0%	1.5%	WebCore	  WebCore::Editor::clientIsEditable() const
	0.0%	1.5%	WebCore	   WebCore::Frame::isContentEditable() const
	0.0%	1.5%	WebCore	    WebCore::HTMLElement::isContentEditable() const
Comment 4 Ryosuke Niwa 2011-02-03 02:07:24 PST
It seems like we need to make Node::isContentEditable and Element::isContentEditable non-virtual inline function.  They are called way too frequently to be virtual.
Comment 5 Ryosuke Niwa 2011-03-08 20:13:11 PST
Now that the bug 54050 has been fixed, I'll resample.
Comment 6 Ryosuke Niwa 2011-03-11 02:08:15 PST
Created attachment 85450 [details]
extend-selection* profile
Comment 7 Ryosuke Niwa 2011-03-11 02:08:56 PST
Created attachment 85451 [details]
move-left-right profile