exponential capacity growth for io::TypedIOBuf
authorPhilip Pronin <philipp@fb.com>
Thu, 17 Oct 2013 03:13:33 +0000 (20:13 -0700)
committerSara Golemon <sgolemon@fb.com>
Thu, 24 Oct 2013 21:53:41 +0000 (14:53 -0700)
commit94fce358e890eb92072c8083cf15b4852feedacf
tree7ef5924011531dc5c18d84ac392a863a4a9ceae4
parent681e46770a9045f8c9c98ae13d3f6205f2be6c85
exponential capacity growth for io::TypedIOBuf

Summary:
Amortized cost of `TypedIOBuf::push()` is `O(N)` at this moment.
Unless we're using jemalloc where we can rely on `realloc()`.  In this
diff we switch to exponential growth otherwise.

Test Plan:
built unicorn/test with ASan (and thus without jemalloc), ran
end-to-end tests and verified we no longer spend minutes to build di4

@override-unit-failures

Reviewed By: tudorb@fb.com

FB internal diff: D1015233
folly/io/TypedIOBuf.h