by _gabe_ · 4y ago · 0 comments
I wondered what code I had written that caused such a massive performance hit in debug mode. So I went to profile my code in a debug build to find out. Lo and behold, something like 90% of the CPU time was wasted doing lookups from std::unordered_map because of debug iterators. I tried everything I could to just turn debug iterators off, and eventually gave up and switched to robin_hood::unordered_map which runs great in debug and release. Now I have an unwarranted aversion to the std lib, even though it really is great so long as you're running it in release mode.
But you can go the other direction: start with release mode (make a separate build profile if you like) and turn on all debug features except debug iterators (and the debug CRT).
MSVC then, I presume.