Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"home-brew" STL for performance?

Tags:

stl

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2271.html

According to that article STL isn't suited for game-development. What are your thoughts about this ?

My current approach is this : use STL, if leads to performance problems exchange with homebrew container (or allocator) (didn't come to it yet, but I'm not doing a high-end 3d game ;) )

like image 916
qwerty Avatar asked Nov 28 '22 20:11

qwerty


1 Answers

Your approach is the only sane option in this case. Rule #1 for optimization is "do not optimize unless you know exactly where the bottlenecks are".

You should still be able to swap your container relatively easily later on, especially if you use a type defined via typedef instead of directly using the STL container. I mean something like:

#include <vector>

typedef std::vector<int> MyIntVectorType;

int main()
{
   MyIntVectorType theVector; 
}
like image 98
Adrian Grigore Avatar answered Mar 04 '23 16:03

Adrian Grigore