Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Pre-MainLoop Calculations

Author
Message
Amnzero
15
Years of Service
User Offline
Joined: 1st Aug 2009
Location:
Posted: 11th Aug 2009 16:53
As you can see in the attached image:

FPS in the top left corner indicates a whopping 11, but I did see it peak at 12. We also see I am in windowed mode, and what you cant see, I am also debugging.

This was acheived positioning, sizing and animating two sprites dynamically at runtime in 1024x768x32. This particular benchmark was solitary. It was executed in a tight for loop, independently from any other code.

Sweet.

The moral:

Keep as many complex calculations as you can manage outside of your main loop. Pre calculate into global variables whatever is not subject to change often. Squeeze as many cycles as you can out of that processor...

if(enemy == Amnzero) runAway();
Amnzero->WebSite = L"http://neovance.com/";

Attachments

Login to view attachments
Amnzero
15
Years of Service
User Offline
Joined: 1st Aug 2009
Location:
Posted: 11th Aug 2009 18:32
Ok so who would like to share optimization tips with the rest of the community? I noticed there is not really a thread for code optimization.

If you have anything on the subject post about it here.

if(enemy == Amnzero) runAway();
Amnzero->WebSite = L"http://neovance.com/";
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 11th Aug 2009 18:55
A very interesting document can be found here :

http://www.tantalon.com/pete/cppopt/main.htm

regarding C++ code optimizations .... many many things to think about

If it ain't broke.... DONT FIX IT !!!
Amnzero
15
Years of Service
User Offline
Joined: 1st Aug 2009
Location:
Posted: 11th Aug 2009 21:17
Yeah that is a really nice place to start! That is some excellent information to know.

if(enemy == Amnzero) runAway();
Amnzero->WebSite = L"http://neovance.com/";

Login to post a reply

Server time is: 2024-11-20 17:43:04
Your offset time is: 2024-11-20 17:43:04