4 ms·
Not using the STL in and of itself is not terrible advice, it's a trade-off. For example, I tend to avoid the STL because of how inconsistent it is across the v
by Kranar 3y ago
Not using the STL in and of itself is not terrible advice, it's a trade-off. For example, I tend to avoid the STL because of how inconsistent it is across the various compilers in terms of performance, bugs, and behavior. The standard leaves a great deal of ambiguity in how the STL behaves and those inconsistencies can be frustrating to deal with when you're writing cross platform software. Furthermore plenty of embedded systems also cut out the STL entirely due to disabling exceptions. Using fast-math is also a perfectly acceptable option for numerous domains that do not need strict IEEE conformance, such as graphics programming or training neural networks.
If people were to listen to your advice, no one would ever post any kind of article on how to achieve certain specific goals, all we'd ever discuss are very generic topics and constantly rehash the same content over and over again. It's good to be able to learn how certain developers manage to accomplish various goals without having someone come along and call that advice terrible.
- maccard 3y ago> For example, I tend to avoid the STL because of how inconsistent it is across the various compilers in terms of performance and behavior. What are your targets? This was my experience 10 years ago, but today with modern (last 5-6 years) MSVC, GCC and Clang (and even on modern Xbox and Playstation toolchains) my experience has been that it's close enough.
- kwant_kiddo 3y agoEven just between x86 and ARM there can be a big enough difference in performance s.t your product straight up does not work on one platform, and that is with the current gcc toolchain. I have been working with small embedded devices so this may be an outlier here compared to the rest of the C/C++ world.
- maccard 3y agoWe target both x64 and arm, and I'm not aware of any restrictions we place on STL usage. That said, we don't target embedded devices, so your world is _definitely_ different to mine!