3 ms·
Loading the same file from disk twice (which will be cached in memory) and parsing a file are not the same things. Furthermore almost every C++ compiler I'm awa
by Kranar 4y ago
Loading the same file from disk twice (which will be cached in memory) and parsing a file are not the same things. Furthermore almost every C++ compiler I'm aware of, including icc, gcc, clang, msvc, has optimizations to special case header guards.
- ncmncm 4y agoEvery C++ compiler still in use will not even try to open a header-guarded or #pragma once file it has already seen. Anybody trying to optimize on top of that is engaged in foolish superstition. (If you are still using Sun's pre-Standard compiler, you are not reading this. I think even Bloomberg has abandoned that.)