"public/service.te" did not exist on "7df44d82767ea036a71ecca0dd936eb55d8b9216"
Preprocessor: Use std::string instead of std::stringstream
std::stringstream has a measurable overhead for preprocessing - it appears that operator<< does a tiny bit of extra work for appending chars/strings and also can't be inlined in most cases on VS2015; additionally, std::endl triggers a stream flush which also adds up. Replacing this with std::string buffer gets the preprocessing time down from 180ms to 135ms in one case, making it 1.33x faster. Note that integer-to-string conversion is using std::to_string; in theory this could be slower than sprintf or manual conversion, but I haven't found these cases to affect preprocessing time in practice (std::to_string would always use the short string buffer for line/version numbers, and the number of calls is not too significant).
Loading
Please register or sign in to comment