Optimize structured cloning of strings with a StringBuffer
Categories
(Core :: JavaScript Engine, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox130 | --- | fixed |
People
(Reporter: jandem, Assigned: jandem)
References
(Blocks 1 open bug)
Details
(Whiteboard: [sp3])
Attachments
(1 file)
If we're doing a same-process structured clone, it should be possible to avoid string copies for strings with a buffer, similar to the optimizations we have for (shared) array buffers.
This would make it much cheaper to pass large strings to/from DOM workers.
Updated•8 months ago
|
Updated•7 months ago
|
Updated•7 months ago
|
Assignee | ||
Comment 1•7 months ago
|
||
I wrote a patch for this and it seems to work.
When loading Gmail, this avoids serializing a number of JS strings of length 20k to 50k. Pretty nice.
Assignee | ||
Comment 2•7 months ago
|
||
If a JS string has a StringBuffer
and we're doing a same-process structured clone,
pass the underlying reference instead of serializing/deserializing the string contents.
This lets us avoid copying some very large strings on websites like Gmail.
This is based on code we have for sharing the underlying buffer of a SharedArrayBuffer
.
![]() |
||
Comment 6•7 months ago
|
||
bugherder |
Comment 7•7 months ago
|
||
Perfherder has detected a devtools performance change from push 95e7752918e2d7562f349350c84c718ecbe4529f.
Improvements:
Ratio | Test | Platform | Options | Absolute values (old vs new) |
---|---|---|---|---|
3% | damp custom.jsdebugger.project-search.first-search-result.DAMP | linux1804-64-shippable-qr | e10s fission stylo webrender | 325.73 -> 314.39 |
3% | damp custom.jsdebugger.project-search.first-search-result.DAMP | linux1804-64-shippable-qr | e10s fission stylo webrender | 324.48 -> 313.93 |
3% | damp custom.jsdebugger.project-search.first-search-result.DAMP | windows11-64-shippable-qr | e10s fission stylo webrender | 254.59 -> 247.34 |
Details of the alert can be found in the alert summary, including links to graphs and comparisons for each of the affected tests.
If you need the profiling jobs you can trigger them yourself from treeherder job view or ask a sheriff to do that for you.
You can run these tests on try with ./mach try perf --alert 1546
For more information on performance sheriffing please see our FAQ.
Description
•