mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:07:35 +00:00
LibJS: Keep track of PrimitiveStrings and share them
VM now has a string cache which tracks all live PrimitiveStrings and reuses an existing one if possible. This drastically reduces the number of GC-allocated strings in many real-word situations.
This commit is contained in:
parent
ba6e4c7ae1
commit
f290c59dd8
3 changed files with 13 additions and 1 deletions
|
@ -52,6 +52,7 @@ Heap::Heap(VM& vm)
|
|||
|
||||
Heap::~Heap()
|
||||
{
|
||||
vm().string_cache().clear();
|
||||
collect_garbage(CollectionType::CollectEverything);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue