Bug 165003

Summary: Streamline and speed up tokenizer and segmented string classes
Product: WebKit Reporter: Darin Adler <darin>
Component: Page LoadingAssignee: Darin Adler <darin>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, beidson, buildbot, cdumez, commit-queue, mitz, rniwa, ryanhaddad, saam, sam
Priority: P2    
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Bug Depends on: 165188    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Archive of layout-test-results from ews102 for mac-yosemite
none
Archive of layout-test-results from ews105 for mac-yosemite-wk2
none
Archive of layout-test-results from ews115 for mac-yosemite
none
Archive of layout-test-results from ews121 for ios-simulator-wk2
none
Patch
none
Archive of layout-test-results from ews117 for mac-yosemite
none
Archive of layout-test-results from ews103 for mac-yosemite
none
Archive of layout-test-results from ews106 for mac-yosemite-wk2
none
Archive of layout-test-results from ews122 for ios-simulator-wk2
none
Patch
none
Archive of layout-test-results from ews114 for mac-yosemite
none
Patch
none
Patch sam: review+

Description Darin Adler 2016-11-20 21:21:42 PST
Streamline and speed up tokenizer and segmented string classes
Comment 1 Darin Adler 2016-11-21 00:35:07 PST
Created attachment 295282 [details]
Patch
Comment 2 Build Bot 2016-11-21 01:25:56 PST
Comment on attachment 295282 [details]
Patch

Attachment 295282 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/2550774

Number of test failures exceeded the failure limit.
Comment 3 Build Bot 2016-11-21 01:25:59 PST
Created attachment 295283 [details]
Archive of layout-test-results from ews102 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews102  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 4 Build Bot 2016-11-21 01:27:34 PST
Comment on attachment 295282 [details]
Patch

Attachment 295282 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/2550776

Number of test failures exceeded the failure limit.
Comment 5 Build Bot 2016-11-21 01:27:37 PST
Created attachment 295284 [details]
Archive of layout-test-results from ews105 for mac-yosemite-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews105  Port: mac-yosemite-wk2  Platform: Mac OS X 10.10.5
Comment 6 Build Bot 2016-11-21 01:32:43 PST
Comment on attachment 295282 [details]
Patch

Attachment 295282 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/2550781

Number of test failures exceeded the failure limit.
Comment 7 Build Bot 2016-11-21 01:32:46 PST
Created attachment 295285 [details]
Archive of layout-test-results from ews115 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews115  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 8 Build Bot 2016-11-21 01:36:11 PST
Comment on attachment 295282 [details]
Patch

Attachment 295282 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/2550779

Number of test failures exceeded the failure limit.
Comment 9 Build Bot 2016-11-21 01:36:14 PST
Created attachment 295286 [details]
Archive of layout-test-results from ews121 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews121  Port: ios-simulator-wk2  Platform: Mac OS X 10.11.6
Comment 10 Darin Adler 2016-11-21 01:59:08 PST
Created attachment 295287 [details]
Patch
Comment 11 Build Bot 2016-11-21 03:11:55 PST
Comment on attachment 295287 [details]
Patch

Attachment 295287 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/2551069

Number of test failures exceeded the failure limit.
Comment 12 Build Bot 2016-11-21 03:12:00 PST
Created attachment 295288 [details]
Archive of layout-test-results from ews117 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews117  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 13 Build Bot 2016-11-21 03:15:07 PST
Comment on attachment 295287 [details]
Patch

Attachment 295287 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/2551087

New failing tests:
http/tests/security/contentSecurityPolicy/default-src-inline-blocked.html
http/tests/security/contentSecurityPolicy/injected-inline-script-blocked.html
fast/dom/nested-script-exceptions.html
fast/dom/Document/document-write-recursion.html
http/tests/security/contentSecurityPolicy/injected-inline-style-blocked.html
http/tests/security/contentSecurityPolicy/inline-script-blocked.html
Comment 14 Build Bot 2016-11-21 03:15:11 PST
Created attachment 295290 [details]
Archive of layout-test-results from ews103 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews103  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 15 Build Bot 2016-11-21 03:17:01 PST
Comment on attachment 295287 [details]
Patch

Attachment 295287 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/2551086

New failing tests:
http/tests/security/contentSecurityPolicy/default-src-inline-blocked.html
http/tests/security/contentSecurityPolicy/injected-inline-script-blocked.html
fast/dom/nested-script-exceptions.html
fast/dom/Document/document-write-recursion.html
http/tests/security/contentSecurityPolicy/injected-inline-style-blocked.html
http/tests/security/contentSecurityPolicy/inline-script-blocked.html
Comment 16 Build Bot 2016-11-21 03:17:06 PST
Created attachment 295291 [details]
Archive of layout-test-results from ews106 for mac-yosemite-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews106  Port: mac-yosemite-wk2  Platform: Mac OS X 10.10.5
Comment 17 Build Bot 2016-11-21 03:44:32 PST
Comment on attachment 295287 [details]
Patch

Attachment 295287 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/2551105

New failing tests:
http/tests/security/contentSecurityPolicy/default-src-inline-blocked.html
http/tests/security/contentSecurityPolicy/injected-inline-script-blocked.html
fast/dom/nested-script-exceptions.html
fast/dom/Document/document-write-recursion.html
http/tests/security/contentSecurityPolicy/injected-inline-style-blocked.html
http/tests/security/contentSecurityPolicy/inline-script-blocked.html
Comment 18 Build Bot 2016-11-21 03:44:36 PST
Created attachment 295292 [details]
Archive of layout-test-results from ews122 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews122  Port: ios-simulator-wk2  Platform: Mac OS X 10.11.6
Comment 19 Darin Adler 2016-11-21 09:34:38 PST
Created attachment 295298 [details]
Patch
Comment 20 Build Bot 2016-11-21 10:53:43 PST
Comment on attachment 295298 [details]
Patch

Attachment 295298 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/2552519

New failing tests:
fast/forms/style-display-none.html
Comment 21 Build Bot 2016-11-21 10:53:47 PST
Created attachment 295301 [details]
Archive of layout-test-results from ews114 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews114  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 22 Darin Adler 2016-11-21 11:11:59 PST
Created attachment 295304 [details]
Patch
Comment 23 Darin Adler 2016-11-21 11:12:50 PST
OK, I expect this time it will pass all tests. I’m measuring a 3% speedup in Speedometer on my iMac.
Comment 24 Darin Adler 2016-11-21 14:40:28 PST
Created attachment 295313 [details]
Patch
Comment 25 Darin Adler 2016-11-22 09:17:11 PST
All tests passing. No rush to review this since I’ll be out of town for a few days, but I think it’s ready to go.
Comment 26 Darin Adler 2016-11-28 09:21:00 PST
I hope someone gets a chance to review this soon. I wonder what kind of speedup we will see on ARM.
Comment 27 Sam Weinig 2016-11-28 17:02:43 PST
Comment on attachment 295313 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=295313&action=review

> Source/WebCore/html/track/BufferedLineReader.cpp:95
> +        String line = m_lineBuffer.toString();

auto?
Comment 28 Darin Adler 2016-11-28 20:30:17 PST
Committed r209058: <http://trac.webkit.org/changeset/209058>
Comment 29 Saam Barati 2016-11-29 11:45:28 PST
It looks like this is a 33% regression on the json-stringify-tinderbox Kraken test, leading to a 1-1.5% regression on the overall Kraken benchmark.
Comment 30 WebKit Commit Bot 2016-11-29 20:50:16 PST
Re-opened since this is blocked by bug 165188
Comment 31 Ryan Haddad 2016-11-29 20:56:49 PST
*** Bug 165142 has been marked as a duplicate of this bug. ***
Comment 32 Ryan Haddad 2016-11-29 20:57:08 PST
*** Bug 165151 has been marked as a duplicate of this bug. ***
Comment 33 Ryan Haddad 2016-11-29 21:01:11 PST
(In reply to comment #30)
> Re-opened since this is blocked by bug 165188

Rolled out this change in https://trac.webkit.org/r209120 due to it breaking an API test. See these bugs for details:

https://bugs.webkit.org/show_bug.cgi?id=165142
https://bugs.webkit.org/show_bug.cgi?id=165151
Comment 34 Darin Adler 2016-11-30 08:59:35 PST
Committed r209129: <http://trac.webkit.org/changeset/209129>
Comment 35 Darin Adler 2016-11-30 09:02:07 PST
(In reply to comment #29)
> It looks like this is a 33% regression on the json-stringify-tinderbox
> Kraken test, leading to a 1-1.5% regression on the overall Kraken benchmark.

Oh, I didn’t see this comment!

I will roll out the JSON stringify part of this patch and tackle the slowness in that function another way. I’ll do that right now.
Comment 36 Chris Dumez 2016-11-30 09:34:02 PST
(In reply to comment #28)
> Committed r209058: <http://trac.webkit.org/changeset/209058>

Still running A/B testing but it looks like a ~1% progression on Speedometer.
Comment 37 Saam Barati 2016-12-02 12:42:12 PST
For posterity: stringify bits rolled out in:
https://trac.webkit.org/changeset/209173