4 ms·
> Huh? C is certainly faster than C++. It literally isn't. Quite often the reverse is true, as C++ gives you better tools for compile-time optimizations. > Th
by kllrnohj 7y ago
> Huh? C is certainly faster than C++.
It literally isn't. Quite often the reverse is true, as C++ gives you better tools for compile-time optimizations.
> That is a terrible example. You shouldn't be using the STL (i.e. std::string copying) for performance critical sections to begin with.
I think you're confusing the example with a recommendation to use the STL?
std::string is just an example of SSO. The concept is generally applicable and used in more places than just the STL.
Although "You shouldn't be using the STL for performance critical sections to begin with." is also complete fucking bullshit anyway. There's nothing wrong with the performance of eg std::array. Or unique_ptr. Or vector. Or a variety of other things in the STL. You're not outperforming any of those with raw C.
It's not 2003 anymore so stop acting like it.
- codesushi42 7y agoIt is 2019 and even game programmers still avoid STL for performance reasons. And optimization is taken to another level from that on embedded systems. I hate to remind you again, but it is 2019 and C is still very relevant on embedded systems. And Javascript, not so much. Snicker
- pjmlp 7y agoSurely not the same game programmers that use Unreal with its C++ GC.
- codesushi42 7y agoWhat does that have to do with anything? Yes, those same game programmers avoid STL. No one is advocating replacing C++ with C on capable hardware, troll.
- kllrnohj 7y ago> It is 2019 and even game programmers still avoid STL for performance reasons. No they don't. They avoid parts of the STL. GDC round-table as far back as 2001 had 40% of shipping games using the STL: http://www.tantalon.com/pete/gdc01_round_table_report.htm http://www.tantalon.com/pete/gdc01_round_table_report.htm Many of the containers in the STL have performance problems. Yes avoid those (and avoid the god-awful iostream). But large chunks of the STL have no performance issues at all, and re-inventing it is just a waste of your time. Games don't avoid things like std::vector for performance issues, they use their own thing because they want even more features.