WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
200862
Use makeString and multi-argument StringBuilder::append instead of less efficient multiple appends
https://bugs.webkit.org/show_bug.cgi?id=200862
Summary
Use makeString and multi-argument StringBuilder::append instead of less effic...
Darin Adler
Reported
2019-08-17 14:03:27 PDT
Use makeString and multi-argument StringBuilder::append instead of less efficient multiple appends
Attachments
Patch
(61.56 KB, patch)
2019-08-17 16:35 PDT
,
Darin Adler
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews101 for mac-highsierra
(3.65 MB, application/zip)
2019-08-17 17:39 PDT
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews115 for mac-highsierra
(3.88 MB, application/zip)
2019-08-17 18:16 PDT
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews215 for win-future
(13.97 MB, application/zip)
2019-08-17 18:28 PDT
,
EWS Watchlist
no flags
Details
Patch
(61.65 KB, patch)
2019-08-18 08:18 PDT
,
Darin Adler
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews100 for mac-highsierra
(3.26 MB, application/zip)
2019-08-18 09:24 PDT
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews115 for mac-highsierra
(3.51 MB, application/zip)
2019-08-18 10:16 PDT
,
EWS Watchlist
no flags
Details
Patch
(69.74 KB, patch)
2019-08-21 19:05 PDT
,
Darin Adler
rniwa
: review+
Details
Formatted Diff
Diff
Show Obsolete
(7)
View All
Add attachment
proposed patch, testcase, etc.
Darin Adler
Comment 1
2019-08-17 16:35:58 PDT
Comment hidden (obsolete)
Created
attachment 376614
[details]
Patch
EWS Watchlist
Comment 2
2019-08-17 17:39:40 PDT
Comment hidden (obsolete)
Comment on
attachment 376614
[details]
Patch
Attachment 376614
[details]
did not pass mac-ews (mac): Output:
https://webkit-queues.webkit.org/results/12933334
New failing tests: imported/w3c/web-platform-tests/css/css-shapes/parsing/shape-outside-valid.html css3/shapes/shape-outside/values/shape-outside-inset-008.html fast/shapes/parsing/parsing-shape-lengths.html imported/w3c/web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-inset-001.html imported/w3c/web-platform-tests/hr-time/idlharness.html imported/w3c/web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/005.xhtml css3/shapes/shape-outside/values/shape-outside-inset-001.html imported/w3c/web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol.html imported/w3c/web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-inset-002.html imported/w3c/web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-inset-003.html css3/shapes/shape-outside/values/shape-outside-computed-shape-001.html fast/shapes/parsing/parsing-shape-outside.html imported/w3c/web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-inset-006.html css3/shapes/shape-outside/values/shape-outside-inset-003.html imported/w3c/web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-inset-000.html css3/shapes/shape-outside/values/shape-outside-inset-009.html css3/shapes/shape-outside/values/shape-outside-inset-002.html css3/shapes/shape-outside/values/shape-outside-inset-000.html fast/masking/parsing-clip-path-shape.html imported/w3c/web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/005.xhtml css3/shapes/shape-outside/values/shape-outside-inset-006.html css3/shapes/shape-outside/values/shape-outside-inset-004.html imported/w3c/web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-inset-009.html imported/w3c/web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-computed-shape-001.html imported/w3c/web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-inset-008.html imported/w3c/web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-inset-004.html
EWS Watchlist
Comment 3
2019-08-17 17:39:41 PDT
Comment hidden (obsolete)
Created
attachment 376618
[details]
Archive of layout-test-results from ews101 for mac-highsierra The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews101 Port: mac-highsierra Platform: Mac OS X 10.13.6
EWS Watchlist
Comment 4
2019-08-17 18:16:29 PDT
Comment hidden (obsolete)
Comment on
attachment 376614
[details]
Patch
Attachment 376614
[details]
did not pass mac-debug-ews (mac): Output:
https://webkit-queues.webkit.org/results/12933368
New failing tests: imported/w3c/web-platform-tests/css/css-shapes/parsing/shape-outside-valid.html css3/shapes/shape-outside/values/shape-outside-inset-008.html fast/shapes/parsing/parsing-shape-lengths.html imported/w3c/web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-inset-001.html dom/xhtml/level3/core/elementsetidattributenode10.xhtml imported/w3c/web-platform-tests/hr-time/idlharness.html imported/w3c/web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/005.xhtml css3/shapes/shape-outside/values/shape-outside-inset-001.html imported/w3c/web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol.html imported/w3c/web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-inset-002.html imported/w3c/web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-inset-003.html css3/shapes/shape-outside/values/shape-outside-computed-shape-001.html fast/shapes/parsing/parsing-shape-outside.html imported/w3c/web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-inset-006.html css3/shapes/shape-outside/values/shape-outside-inset-003.html imported/w3c/web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-inset-000.html css3/shapes/shape-outside/values/shape-outside-inset-009.html css3/shapes/shape-outside/values/shape-outside-inset-002.html css3/shapes/shape-outside/values/shape-outside-inset-000.html fast/masking/parsing-clip-path-shape.html imported/w3c/web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/005.xhtml css3/shapes/shape-outside/values/shape-outside-inset-006.html css3/shapes/shape-outside/values/shape-outside-inset-004.html imported/w3c/web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-inset-009.html dom/xhtml/level3/core/elementsetidattribute11.xhtml imported/w3c/web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-computed-shape-001.html imported/w3c/web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-inset-008.html imported/w3c/web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-inset-004.html
EWS Watchlist
Comment 5
2019-08-17 18:16:31 PDT
Comment hidden (obsolete)
Created
attachment 376620
[details]
Archive of layout-test-results from ews115 for mac-highsierra The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews115 Port: mac-highsierra Platform: Mac OS X 10.13.6
EWS Watchlist
Comment 6
2019-08-17 18:28:24 PDT
Comment hidden (obsolete)
Comment on
attachment 376614
[details]
Patch
Attachment 376614
[details]
did not pass win-ews (win): Output:
https://webkit-queues.webkit.org/results/12933455
New failing tests: css3/shapes/shape-outside/values/shape-outside-inset-009.html css3/shapes/shape-outside/values/shape-outside-inset-008.html css3/shapes/shape-outside/values/shape-outside-inset-002.html css3/shapes/shape-outside/values/shape-outside-inset-001.html css3/shapes/shape-outside/values/shape-outside-inset-006.html fast/shapes/parsing/parsing-shape-lengths.html css3/shapes/shape-outside/values/shape-outside-inset-000.html css3/shapes/shape-outside/values/shape-outside-inset-004.html css3/shapes/shape-outside/values/shape-outside-computed-shape-001.html fast/shapes/parsing/parsing-shape-outside.html fast/masking/parsing-clip-path-shape.html css3/shapes/shape-outside/values/shape-outside-inset-003.html
EWS Watchlist
Comment 7
2019-08-17 18:28:27 PDT
Comment hidden (obsolete)
Created
attachment 376622
[details]
Archive of layout-test-results from ews215 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: ews215 Port: win-future Platform: CYGWIN_NT-10.0-17763-3.0.5-338.x86_64-x86_64-64bit
EWS Watchlist
Comment 8
2019-08-17 18:44:17 PDT
Comment hidden (obsolete)
Comment on
attachment 376614
[details]
Patch
Attachment 376614
[details]
did not pass jsc-ews (mac): Output:
https://webkit-queues.webkit.org/results/12933360
New failing tests: slowMicrobenchmarks.yaml/slowMicrobenchmarks/function-constructor-with-huge-strings.js.no-ftl slowMicrobenchmarks.yaml/slowMicrobenchmarks/function-constructor-with-huge-strings.js.default slowMicrobenchmarks.yaml/slowMicrobenchmarks/function-constructor-with-huge-strings.js.ftl-no-cjit-validate-sampling-profiler slowMicrobenchmarks.yaml/slowMicrobenchmarks/function-constructor-with-huge-strings.js.no-cjit
Darin Adler
Comment 9
2019-08-18 08:18:14 PDT
Comment hidden (obsolete)
Created
attachment 376639
[details]
Patch
EWS Watchlist
Comment 10
2019-08-18 09:24:28 PDT
Comment hidden (obsolete)
Comment on
attachment 376639
[details]
Patch
Attachment 376639
[details]
did not pass mac-ews (mac): Output:
https://webkit-queues.webkit.org/results/12936206
New failing tests: imported/w3c/web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/005.xhtml imported/w3c/web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol.html imported/w3c/web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/005.xhtml imported/w3c/web-platform-tests/hr-time/idlharness.html
EWS Watchlist
Comment 11
2019-08-18 09:24:30 PDT
Comment hidden (obsolete)
Created
attachment 376640
[details]
Archive of layout-test-results from ews100 for mac-highsierra The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews100 Port: mac-highsierra Platform: Mac OS X 10.13.6
EWS Watchlist
Comment 12
2019-08-18 10:16:26 PDT
Comment hidden (obsolete)
Comment on
attachment 376639
[details]
Patch
Attachment 376639
[details]
did not pass mac-debug-ews (mac): Output:
https://webkit-queues.webkit.org/results/12936243
New failing tests: imported/w3c/web-platform-tests/hr-time/idlharness.html dom/xhtml/level3/core/elementsetidattributenode10.xhtml imported/w3c/web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/005.xhtml imported/w3c/web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol.html dom/xhtml/level3/core/elementsetidattribute11.xhtml imported/w3c/web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/005.xhtml
EWS Watchlist
Comment 13
2019-08-18 10:16:27 PDT
Comment hidden (obsolete)
Created
attachment 376641
[details]
Archive of layout-test-results from ews115 for mac-highsierra The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews115 Port: mac-highsierra Platform: Mac OS X 10.13.6
EWS Watchlist
Comment 14
2019-08-18 10:25:36 PDT
Comment hidden (obsolete)
Comment on
attachment 376639
[details]
Patch
Attachment 376639
[details]
did not pass jsc-ews (mac): Output:
https://webkit-queues.webkit.org/results/12936223
New failing tests: slowMicrobenchmarks.yaml/slowMicrobenchmarks/function-constructor-with-huge-strings.js.no-ftl slowMicrobenchmarks.yaml/slowMicrobenchmarks/function-constructor-with-huge-strings.js.default slowMicrobenchmarks.yaml/slowMicrobenchmarks/function-constructor-with-huge-strings.js.ftl-no-cjit-validate-sampling-profiler slowMicrobenchmarks.yaml/slowMicrobenchmarks/function-constructor-with-huge-strings.js.no-cjit
Sam Weinig
Comment 15
2019-08-18 15:32:30 PDT
Comment on
attachment 376639
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=376639&action=review
> Source/WebCore/css/CSSFontFaceRule.cpp:53 > StringBuilder result;
This is unused and can be removed.
> Source/WebCore/css/CSSFontFaceSrcValue.cpp:77 > result.appendLiteral("local("); > else > result.appendLiteral("url("); > - result.append(m_resource); > - result.append(')'); > - if (!m_format.isEmpty()) { > - result.appendLiteral(" format("); > - result.append(m_format); > - result.append(')'); > - } > + result.append(m_resource, ')');
It might read a little nicer to put literals ("local(" or "url(") as a ternary expression for the first parameter.
> Source/WebCore/css/CSSGradientValue.cpp:941 > result.appendLiteral("color-stop("); > result.appendFixedPrecisionNumber(position); > - result.appendLiteral(", "); > - result.append(stop.m_color->cssText()); > - result.append(')'); > + result.append(", ", stop.m_color->cssText(), ')');
If you wanted to, you could collapse all the appends here doing, result.append("color-stop(", FormattedNumber::fixedPrecision(position), ", ", stop.m_color->cssText(), ')').
Darin Adler
Comment 16
2019-08-18 16:37:36 PDT
Looks like the test failures indicate a failure of StringBuilder::append!
Darin Adler
Comment 17
2019-08-18 16:47:23 PDT
(In reply to Darin Adler from
comment #16
)
> Looks like the test failures indicate a failure of StringBuilder::append!
Yes, I think I see a bug in StringBuilder::appendForAdapters when the string is 8-bit, the thing to be appended is 16-bit, and the 8-bit buffer is big enough to hold the new length. There's no call to allocateBufferUpConvert in that case, yet there needs to be.
Darin Adler
Comment 18
2019-08-18 16:56:05 PDT
Comment on
attachment 376639
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=376639&action=review
I’ll upload a new patch after I fix the bug in StringBuilder::append.
>> Source/WebCore/css/CSSFontFaceRule.cpp:53 >> StringBuilder result; > > This is unused and can be removed.
Done.
>> Source/WebCore/css/CSSFontFaceSrcValue.cpp:77 >> + result.append(m_resource, ')'); > > It might read a little nicer to put literals ("local(" or "url(") as a ternary expression for the first parameter.
Done, and then converted the function to makeString instead of StringBuilder.
>> Source/WebCore/css/CSSGradientValue.cpp:941 >> + result.append(", ", stop.m_color->cssText(), ')'); > > If you wanted to, you could collapse all the appends here doing, result.append("color-stop(", FormattedNumber::fixedPrecision(position), ", ", stop.m_color->cssText(), ')').
Yes, happy to do that. I think there’s quite a bit more to collapse elsewhere too; I was working on doing more and more of this and it got a little "out of hand" and so I stopped myself and wanted to land what I had. Done.
Darin Adler
Comment 19
2019-08-18 16:56:53 PDT
(In reply to Darin Adler from
comment #17
)
> (In reply to Darin Adler from
comment #16
) > > Looks like the test failures indicate a failure of StringBuilder::append! > > Yes, I think I see a bug in StringBuilder::appendForAdapters when the string > is 8-bit, the thing to be appended is 16-bit, and the 8-bit buffer is big > enough to hold the new length. There's no call to allocateBufferUpConvert in > that case, yet there needs to be.
Sadly, in the case where the test was failing the string doesn't even need to be 16-bit, but one of the substrings happens to be allocated as 16-bit even though all the characters in it are Latin-1.
Darin Adler
Comment 20
2019-08-18 17:20:09 PDT
Comment on
attachment 376639
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=376639&action=review
> Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.cpp:166 > builder.append(objectStore.loggingString(1)); > builder.append('\n');
Should probably combine these two also.
Darin Adler
Comment 21
2019-08-20 09:05:32 PDT
Fixing the StringBuilder::appendForAdapters bug in
bug 200921
, and then will post a new patch for this bug so EWS can show us the tests succeeding.
Darin Adler
Comment 22
2019-08-21 19:05:48 PDT
Created
attachment 376963
[details]
Patch
Ryosuke Niwa
Comment 23
2019-08-21 21:03:10 PDT
Comment on
attachment 376963
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=376963&action=review
> Source/JavaScriptCore/runtime/TypeSet.cpp:416 > + representation.append(StringView { field.get() }, ", ");
Do we need to explicitly create StringView here?
> Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp:114 > +
This seems unrelated not that it matters either way.
> Tools/WebKitTestRunner/TestController.cpp:1101 > + response = makeString(TestController::webProcessName(), ": ", webContentPID, '\n', > + TestController::networkProcessName(), ": ", networkingPID, '\n');
Should we just call dumpResponse instead?
> Tools/WebKitTestRunner/TestController.cpp:1103 > - builder.append('\n'); > + response = "\n"_s;
And here?
Darin Adler
Comment 24
2019-08-22 09:02:32 PDT
I can’t figure out what the Windows build failure is or if it was caused by this patch. I don’t know why most EWS results are missing. Maybe "New EWS" isn’t working at all at this time?
Darin Adler
Comment 25
2019-08-22 09:26:12 PDT
Committed
r249013
: <
https://trac.webkit.org/changeset/249013
>
Radar WebKit Bug Importer
Comment 26
2019-08-22 09:27:45 PDT
<
rdar://problem/54601523
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug