Advertisement Jump to content
Sign in to follow this  

measuring efficiency in a game

This topic is 1809 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?





Share this post

Link to post
Share on other sites

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.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!