measuring efficiency in a game

Started by
2 comments, last by too_many_stars 10 years, 2 months ago

Hello everyone,

I have a general question I have been thinking about for some time. My gaming experience so far has involved 2D side scrollers. Every now and then I read up on statements such as "trig ratio functions are resource expensive" and "SDL rotozoom should not be used as it's too costly."

I am sure that these statements are true, but how does a newbie game developer measure or keep track of how resource intensive a game is? Obviously when the application slows down I know too many resource are being used, but are there are programs, strategies or advice that someone can tell me about which will point me in the right direction in measuring program efficiency?

Thanks,

Mike

Advertisement

Google: Profiler.

[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

A profiler is the tool to use, but a bit of a longer description is probably in order as this is For Beginners forum.

The cost of doing something is relative.

The cost of floating point operations is expensive relative to the cost of pure integer operations, but modern games use floating point numbers all the time.

The cost of accessing data on the disk is much greater than accessing data already in memory, but people load data from disk call the time.

A profiler is a tool that measures how long things take. They have a bit of a learning curve, but once you learn how to use them you can isolate the approximate cost of just about anything. Over time as you gain experience, you will come to learn approximately how long things should take.

You might discover that your code is making millions of calls to strlen() every frame, or that 70% of your time is being spent in memory allocation, or that your pathfinder requires 8ms to run. Once your experience teaches the patterns and timings that are common you will learn to quickly identify performance metrics that are problematic.

Thanks for the advice guys, I will check out this profiler. It's incredible how much there is to learn in game programing.

Mike

This topic is closed to new replies.

Advertisement