-
Wouter van Oortmerssen authored
Previously, FlatBufferBuilder used 3 resizable buffers: - serialization (vector_downward) - field offsets (std::vector) - vtable offsets (std::vector) Since the serialization buffer grows downwards, the bottom part of it can be used as a "scratchpad" storage for the other two. Since field offsets are only accumulated during table construction, and vtable offsets only after table construction, the two can trivially share the same storage. Not only does this reduce the amount of allocation, it also removes the bulk of std::vector usage from FlatBufferBuilder which was the #1 cause of slow-down in debug mode, see e.g.: https://stackoverflow.com/questions/36085285/any-way-to-improve-flatbuffer-performance-in-debug-c-msvc Change-Id: I0224cf2f2a863d2d7ef762bc9163b52fdc149522 Tested: on Linux.
79b80f84