Allocate more JS strings with a StringBuffer instead of raw malloc
Categories
(Core :: JavaScript Engine, task, P2)
Tracking
()
People
(Reporter: jandem, Assigned: jandem)
References
(Blocks 1 open bug, Regressed 1 open bug)
Details
(Keywords: leave-open)
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•7 days ago
|
||
This patch adds a usesStringBuffer
argument to checkStringCharsArena
so that
we can have this check and comment in one place.
Assignee | ||
Comment 2•7 days 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•7 days 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•7 days 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•4 days ago
|
Pushed by jdemooij@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/15b620ae11bf part 1 - Tidy up checkStringCharsArena checks. r=sfink https://hg.mozilla.org/integration/autoland/rev/1e290c561e40 part 2 - Refactor OwnedChars to prepare for StringBuffer support. r=sfink https://hg.mozilla.org/integration/autoland/rev/ee041ddb584c part 3 - Add StringBuffer support to OwnedChars. r=sfink
Comment 6•4 days ago
|
||
bugherder |
Updated•3 days ago
|
Assignee | ||
Comment 7•3 days 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•22 hours 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
Description
•