Add an arena for allocating strings.#2532
Conversation
This reduces the amount of malloc traffic significantly, speeding up parsing. For a no-op build of Chromium (Linux, Zen 2), this reduces time spent from 4.61 to 4.08 seconds. However, note that it also increases RSS from 914 to 937 MB; I haven't looked deeply into why, but it's reasonable to assume that this is related to the fact that we no longer merge small strings together (since they are now immutable). We still use some time in actually copying the string into the arena, but it seems this is cheaper than just persisting the file contents wholesale and pointing into that.
|
I moved so that the EvalStrings used in Rule are now owned by a smaller arena on the BindingEnv instead of being allocated on the heap and leaked. |
|
I spent a bit of time removing allocations in trimja and the main changes related to
Then the only copies you need to make of Maybe changing the entire |
|
I've submitted 1. here #2696 The second part would need a |
This is the patch we took out during the review of PR #2519, now rebased and re-measured. It's much less memory-bad, but still wins ~12%.
What do you think? Should we still pursue this?