What about speed issues when using the string class, can I use it in game programming or do I have to use C-style strings?
Printable View
What about speed issues when using the string class, can I use it in game programming or do I have to use C-style strings?
string classes always have at least some overhead, but mainly thinking in line of strings, will make you loose your perspective of performance. That's the main reason why I avoid them.
What kind of game are you making and where do you want to have the strings?
I'm not making any kind of game at the moment, I'm reading a book about game programming. I just wanted to know.
We do things like sort 500MB files or search 35 million records.
In that kind of environment, any extra ovehead is bad news.
One way to estimate the relative speed of code blocks is to compile different versions of the same algorithm with the flag set to make asm source listings. The number of lines of generated asm code gives you an approximate idea of relatively how slow or fast the code will run. Really only useful if if you are comparing similar algorithms.
How do I set the flags to generate asm listings in VC++6?Quote:
Originally posted by jim mcnamara
We do things like sort 500MB files or search 35 million records.
In that kind of environment, any extra ovehead is bad news.
One way to estimate the relative speed of code blocks is to compile different versions of the same algorithm with the flag set to make asm source listings. The number of lines of generated asm code gives you an approximate idea of relatively how slow or fast the code will run. Really only useful if if you are comparing similar algorithms.