TheOpenSpaceProgram / new-ospgl

A space exploration game in OpenGL. Devblog: https://tatjam.github.io/index.html
MIT License
42 stars 6 forks source link

inefficent string concatination #22

Open jonesmz opened 4 years ago

jonesmz commented 4 years ago
const std::string fix_key = "_IKEY";
auto n_parse = SerializeUtil::load_string(fix_key + "=" + value);
  1. change fix_key to std::string_view, or "static constexpr auto[]"
  2. Concatinating strings like this is expensive. Take a look here: https://github.com/splinter-build/splinter/blob/15-default-values/src/string_concat.h