GP2X Gp2x And Stl


HexDump

Still Fresh
Joined
Nov 15, 2004
Messages
30
Hi all,

Is anyone using stl with gp2x? Has anybody test if it is suitable to use it with the machine (I mean in terms of speed, overhead).


HexDump.
 
I've used it and not noticed any performance hit, but I wasn't looking for one :)

STL is not intrinsicly inefficient, it depends how you use it. Performance is a tricky thing - yet another 80-20 rule, 80% of the processing is done in 20% of the code, chances are you're going to optimise something in the 80% that didn't really matter. Profiling is the best way to find bottle necks.


EDIT: Put the "not" in
 
Parkydr posted on Jul 5 2006 at 10:44 AM said:
STL is intrinsicly inefficient, it depends how you use it.
The first part of this sentence if plain wrong, whereas the second part is true. STL is NOT intrinsically inefficient!!

The algorithms and containers in the STL library where designed to be efficient. In the documentation of the STL library (Standard Template Library Programmer's Guide) you can also find the complexity specifications for the various algorithms which should make it easier to find the right algorithm for your task. If you have a performance problem when using the STL library it is very likely that you chose the wrong container class or the wrong algorithm.
 
Last edited by a moderator:
Trenki posted on Jul 5 2006 at 12:00 PM said:
Parkydr posted on Jul 5 2006 at 10:44 AM said:
STL is intrinsicly inefficient, it depends how you use it.
The first part of this sentence if plain wrong, whereas the second part is true. STL is NOT intrinsically inefficient!!

Yes, it is totally wrong, just a typo on my part, sorry. :(
 
Last edited by a moderator:
I'm using std::vector<> troughout my code and it works like a charm. I actualy had to slowdown my game because it ran way to fast.
 
Daid posted on Jul 5 2006 at 07:10 AM said:
I'm using std::vector<> troughout my code and it works like a charm. I actualy had to slowdown my game because it ran way to fast.

off topic...
if you are using simple performance-based delay loops then under/overclocking will break your game. you should be using clock-based timing.
 
Last edited by a moderator:
Sparr posted on Jul 5 2006 at 04:20 PM said:
Daid posted on Jul 5 2006 at 07:10 AM said:
I'm using std::vector<> troughout my code and it works like a charm. I actualy had to slowdown my game because it ran way to fast.
off topic...
if you are using simple performance-based delay loops then under/overclocking will break your game. you should be using clock-based timing.
Still offtopic:
Code:
	int LastTickCount = SDL_GetTicks();
	while (!bQuit)
	{
		while(LastTickCount + 12 > SDL_GetTicks());
		LastTickCount = SDL_GetTicks();
Ok, I should define the 12. And not 100% accurate, but I don't want to to be to complicated, or to go insane when it actualy takes longer then 12ms to run trough the mainloop (because that's quite possible with my game).

In the beginning that loop wasn't there, because I thouged it wouldn't run that fast ;)
 
Last edited by a moderator:
Ok, thanks for the answers, only wanted some feedback from someone that used it with the gp2,

Thanks in advance,
HexDump.
 
Back
Top