3 ms·
You might have an interesting project, for all my C++ projects, -O1 is significantly faster than -O0 (~2x faster). Or maybe my projects are the interesting one
by fluffything 6y ago
You might have an interesting project, for all my C++ projects, -O1 is significantly faster than -O0 (~2x faster).
Or maybe my projects are the interesting ones :D
- moonchild 6y agoAh - you are using c++. My project is c, which is why I can use tcc. Anyway, that makes sense; in c++, there's a lot of 'extra' stuff, single lines of code that add up to much more than they would seem. I bet -O1 lets the compiler inline a lot of std::move, smart ptr semantics; elide monomorphisations, copy constructors/RVO; etc. Which just means less code to spit out the backend.
- fluffything 6y agoAh right, for some reason I thought you were talking about C++. Yes for C what you mention makes perfect sense. I agree with you about C++ as well. In particular, C++ templates end up expanding a lot of duplicate code, and at O1 the compiler can remove them.