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).
| Name |
Last commit
|
Last update |
|---|---|---|
| External | Loading commit data... | |
| OGLCompilersDLL | Loading commit data... | |
| SPIRV | Loading commit data... | |
| StandAlone | Loading commit data... | |
| Test | Loading commit data... | |
| glslang | Loading commit data... | |
| gtests | Loading commit data... | |
| hlsl | Loading commit data... | |
| .appveyor.yml | Loading commit data... | |
| .clang-format | Loading commit data... | |
| .gitattributes | Loading commit data... | |
| .gitignore | Loading commit data... | |
| .travis.yml | Loading commit data... | |
| CMakeLists.txt | Loading commit data... | |
| ChooseMSVCCRT.cmake | Loading commit data... | |
| README-spirv-remap.txt | Loading commit data... | |
| README.md | Loading commit data... | |
| known_good.json | Loading commit data... | |
| make-revision | Loading commit data... | |
| update_glslang_sources.py | Loading commit data... |