next.js
1bdb2e20 - Turbopack: shrink amortized (#88619)

Commit
1 day ago
Turbopack: shrink amortized (#88619) ### What? Use amortized shrinking. Capacity should always be a power of 2. We shrink when len is capacity / 3. Assuming the capacity was `2^x` we shrink to `2^(x-1)` which is `capacity / 2`. Therefore capacity is still larger than len, which avoids direct reallocation when items are added again.
Author
Parents
Loading