-ffast-math
use dynamic buffer
keep profiling info (no noticeable overhead)
use memcpy
remove unused line
optimize two buffer copies
use custom dynamic buffer; remove test code

using C++ std::vector resulted in almost 2x code size