memory savings for F14 tables with explicit reserve()
Summary: In the case when an explicit capacity is specified (via reserve() or an initial capacity) we can save memory by using a bucket_count() off of the normal geometric sequence. This is beneficial for sizes <= Chunk::kCapacity for all policies, and for F14Vector tables with any size. In the multi-chunk F14Vector case this will save about 40%*size()*sizeof(value_type) when reserve() is used (such as during Thrift deserialization). The single-chunk savings are potentially larger. The changes do not affect the lookup path and should be a tiny perf win in the non-growing insert case. Exact sizing is only attempted on reserve() or rehash() when the requested capacity is >= 9/8 or <= 7/8 of the current bucket_count(), so it won't trigger O(n^2) behavior even if misused. Reviewed By: yfeldblum Differential Revision: D12848355 fbshipit-source-id: 4f70b4dabf626142cfe370e5b1db581af1a1103f
Showing
Please register or sign in to comment