Allocate more JS strings with a StringBuffer instead of raw malloc
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
(5 files)
I have some patches that add support for StringBuffer to JSString::OwnedChars, and then uses this to allocate more JS strings with string buffers instead of raw malloc.
| Assignee | ||
Comment 1•1 year ago
|
||
This patch adds a usesStringBuffer argument to checkStringCharsArena so that
we can have this check and comment in one place.
| Assignee | ||
Comment 2•1 year ago
|
||
This adds an enum to OwnedChars to make it easier to add a new kind of allocation in
the next patch.
| Assignee | ||
Comment 3•1 year ago
|
||
Also removes the new_ and newValidLength overloads that were added for string
buffers because we can now use the OwnedChars version.
| Assignee | ||
Comment 4•1 year ago
|
||
If there are more than 500 bytes of string data, use a StringBuffer instead of raw malloc.
This helps avoid memory usage regressions because for shorter strings StringBuffer has
relatively more overhead.
| Assignee | ||
Updated•1 year ago
|
Comment 6•1 year ago
|
||
| bugherder | ||
Updated•1 year ago
|
| Assignee | ||
Comment 7•1 year ago
|
||
This avoids some regressions on a few Speedometer 3 (async) sub tests.
The problem is likely more jemalloc lock contention during GC when using the
main malloc heap. Using SpiderMonkey's string buffer arena avoids that and
matches previous behavior better.
Comment 8•1 year ago
|
||
Ill let the sheriffs confirm, but this change appear to have caused 15% regressions on some tests: https://treeherder.mozilla.org/perfherder/alerts?id=995&hideDwnToInv=0
| Assignee | ||
Updated•1 year ago
|
Comment 10•1 year ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/6fe78640acb3
https://hg.mozilla.org/mozilla-central/rev/0584adf37451
Updated•1 year ago
|
Updated•1 year ago
|
Description
•