Chlumsky/json-cpp-gen

Common parser string buffer

Chlumsky opened this issue · 1 comments

It may be slightly beneficial for performance if the generated parser class had a common string buffer member variable instead of temporaries in individual functions, namely:

// TODO make key a class member to reduce the number of allocations
body += indent+generator->stringType()->name().variableDeclaration("key")+";\n";

// TODO make str a class member to reduce the number of allocations
body += indent+generator->stringType()->name().variableDeclaration("str")+";\n";

Implemented in 91fb66a