Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c64df8c3 authored by Shai Barack's avatar Shai Barack
Browse files

Add StringCache, and use it when unparceling Strings

StringCache is like String.intern() but weaker.
The goal is to dedupe runtime string allocations, starting with parceled strings.

This use case was driven by field stats for String allocations, many of which come from incoming parcels.

Results from running this on a local test device:
https://docs.google.com/spreadsheets/d/1HlLZTX88SPHHpjdKkDGI2wvS-vLhBLeSy6EfR9tXMXE/edit?usp=sharing&resourcekey=0-uNRHRp80IMmVqE0Oe1p7og

Most processes are showing >80% hit rate.

After this is merged, I will study the impact in trunk partial on heap size, post-GC metrics, and other memory KPIs.

Flag: android.os.parcel_string_cache_enabled
Bug: 442140362
Test: StringCacheTest

Change-Id: I07912887d4564bc8cd3251b13d7102ff287a34df
parent 979f61ae
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment