mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-11 17:37:00 +02:00
We were already caching UTF-8 and byte strings, so let's add a cache for UTF-16 strings as well. This is particularly profitable whenever we run regular expressions, since the output of regex execution is a set of UTF-16 strings. Note that this is a weak cache like the other JS string caches, meaning that strings are removed from the cache as they are garbage collected. This avoids billions of PrimitiveString allocations across a run of WPT, significantly reducing GC activity. (cherry picked from commit 206479b2b5fc2641a619eb0d05c1185d869ef844)
3.0 KiB
3.0 KiB