Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualrip-off

Posted 22 December 2012 - 02:45 PM

In general, the less memory your program touches the faster it will be. In general, the faster your program completes it's game loop, the more frames it can paint to the screen in a given time period.

However, there is no guarantee that reducing memory will increase frames per second. The relationship between these two is complex, because it ignores a lot of other things your program is doing, such as computation and other I/O. In addition, if you are loading the image on demand multiple times, that disk access is also going to have an impact on how fast your game loop runs.

To systematically optimise, and get the best results for the time spent, you need to identify your bottlenecks. Using a tool such as a profiler, or cruder techniques like inserting code to time certain blocks, find where most of the time is being spent. Then, think of an alternative implementation that you believe will reduce the amount of time spent in these bottlenecks. Finally, measure that the changes have actually had the desired affect.

Your alternative implementation should focus on high level gains, such as improved algorithms and better memory layout before resorting to lower level changes.

In the absence of such analysis, I would expect that eliminating unnecessary disk access and removing redundant data will probably help, at least to some degree.

#1rip-off

Posted 22 December 2012 - 02:44 PM

In general, the less memory your program touches the faster it will be. In general, the faster your program completes it's game loop, the more frames it can paint to the screen in a given time period.<br /><br />However, there is no guarantee that reducing memory will increase frames per second. The relationship between these two is complex, because it ignores a lot of other things your program is doing, such as computation and other I/O. In addition, if you are loading the image on demand multiple times, that disk access is also going to have an impact on how fast your game loop runs.<br /><br />To systematically optimise, and get the best results for the time spent, you need to identify your bottlenecks. Using a tool such as a profiler, or cruder techniques like inserting code to time certain blocks, find where most of the time is being spent. Then, think of an alternative implementation that you believe will reduce the amount of time spent in these bottlenecks. Finally, measure that the changes have actually had the desired affect.<br /><br />Your alternative implementation should focus on high level gains, such as improved algorithms and better memory layout before resorting to lower level changes.<br /><br />In the absence of such analysis, I would expect that eliminating unnecessary disk access and removing redundant data will probably help, at least to some degree.

PARTNERS