Simple line layout: Small tweaks to improve performance.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Jan 2017 00:17:04 +0000 (00:17 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Jan 2017 00:17:04 +0000 (00:17 +0000)
commitf5ebe21a5b5f6c2f032bf30a236b2c08f22b1029
tree96f4da5dfd3a759b89bfdb88207535b6cd414b87
parentc13887486f8ff3ad4ee5db5b361cdaf69098ed40
Simple line layout: Small tweaks to improve performance.
https://bugs.webkit.org/show_bug.cgi?id=167611
<rdar://problem/30274294>

Reviewed by Simon Fraser.

PerformanceTests:

* Layout/simple-line-layout-non-repeating-text.html: Added.

Source/WebCore:

This is ~10% progression on the attached test case (paragraphs with non-redundant content).
median: 102.08 runs/s -> median: 114.25 runs/s

* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::LineState::appendFragmentAndCreateRunIfNeeded):
* rendering/SimpleLineLayoutFlowContents.cpp:
(WebCore::SimpleLineLayout::initializeSegments):
(WebCore::SimpleLineLayout::FlowContents::FlowContents):
* rendering/SimpleLineLayoutFlowContents.h:
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::nextNonWhitespacePosition):
(WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
* rendering/SimpleLineLayoutTextFragmentIterator.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@211394 268f45cc-cd09-0410-ab3c-d52691b4dbfc
PerformanceTests/ChangeLog
PerformanceTests/Layout/simple-line-layout-non-repeating-text.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/SimpleLineLayout.cpp
Source/WebCore/rendering/SimpleLineLayoutFlowContents.cpp
Source/WebCore/rendering/SimpleLineLayoutFlowContents.h
Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.cpp
Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.h