Hacker News new | past | comments | ask | show | jobs | submit login

Using the STL is a non-issue for me as it is almost never used in the video games industry, mostly for performance reasons.

In my opinion the STL is still a big, bloated, unreadable piece of code with a few badly implemented good ideas (containers)

You should read this article: https://zeux.io/2019/01/17/is-c-fast/




I read the article. The author noticed that MSVC's STL has slower iterators in debug mode, because it does extra checks. Instead of reading the manual and turning off the extra checks and/or reading the manual and turning on some optimizations in debug, he re-wrote it in C, which doesn't have the extra checks to begin with, and was happy because it compiled faster. All the optimizations in release mode came from better algorithms or allocators.

I can't say I'm particularly convinced. Yes, C++ debug builds can be slow. For most of us, that's ok. If it's not, make your "debug" build configuration a release build with the optimizer turned down (but not off) and incremental build enabled. Preprocessor definitions, symbol generation, optimization, and incremental build are all independent settings - if all you need from debug is symbols, incremental builds, and the inliner turned down (so stacks are retained) - then configure your compiler that way.


You probably also noticed that the code ended-up being faster, not much bigger and in my opinion easier to read/modify.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: