push_back instead of append is way better for perf
Use stringbuf instead of string

Seems to be a lot faster than string with no length caching.