The original logic creates a HashedReferenceList when the list is very small (which is when the optimization would have least impact). This generates a lot of allocations when creating tiny Pools and also seems unintended. Now, the hashed implementation is used for large Pools (where it is likely to improve performance), and the list is used as-is if small enough.
The original logic creates a
HashedReferenceList
when the list is very small (which is when the optimization would have least impact). This generates a lot of allocations when creating tinyPool
s and also seems unintended. Now, the hashed implementation is used for large Pools (where it is likely to improve performance), and the list is used as-is if small enough.