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.
Showing
Please
register
or
sign in
to comment