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.
Created attachment 81009 [details] extend-selection* profile It seems like the most time is spent in ICU and isContentEditable.
Created attachment 81011 [details] move-left-right profile
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
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.
Now that the bug 54050 has been fixed, I'll resample.
Created attachment 85450 [details] extend-selection* profile
Created attachment 85451 [details] move-left-right profile