Archived

This topic is now archived and is closed to further replies.

DemiGod25

Optimizing...

Recommended Posts

Ready4Dis    180
2 bool checks and one add in any case i can think of. If it''s a seqential read, and it is cached, it is still more than likely slower than doing 2 cmps and an add (due to the function call over-head, and everything else). It would be better to use the 2 bools and an add if you can . Also, it depends on how much you are reading in, and if you have to seek in this file, etc. A read takes a lot more than 2 cmps and an add though, just calling a kernel function like that takes more time than the cmp''s + add, plus the time to check if it''s cached, if not, then it has to get to the proper location on the hard drive, read it in, and return the value, which is pretty slow considering the speed of a modern cpu.

Share this post


Link to post
Share on other sites
Ready4Dis    180
Just remember.. optomize the most heavily called code...

If you optomize the crap out of a loading function that only gets called once, it''s a waste of time. But, if you optomize the main rendering loop, or you optomize the method you are using to do something, it can have substantial gains from small changes. Just make sure you''re optomizing the correct things first .

Share this post


Link to post
Share on other sites
Ready4Dis    180
I am also doing stuff for fun, but wasting time optomizing useless stuff is still wasting time . No point in optomizing an inefficient algorythm to death, if you could replace it with a more efficient one that will run faster non-optomized . I have been found guilty of this on more than one occasion, take my terrain engine for example: I optomized my drawing routine to the max, then i implemented triangle strips with vertex and index buffers, and gained a 100%-200% increase in speed on average, so all that time wasted optomizing an inefficient algorythm is just that... time wasted .

Share this post


Link to post
Share on other sites