News:

PlayBASIC2DLL V0.99 Revision I Commercial Edition released! - Convert PlayBASIC programs to super fast Machine Code. 

Main Menu

Making your code run faster

Started by AdeN, September 26, 2007, 03:36:33 AM

Previous topic - Next topic

AdeN

In order to make your BASIC code run faster it often needs a seemingly endless round of changing something and seeing if it makes any measurable difference to the frame rate of your game. But of course it may be that several different bits of code need to be changed together to make any difference, and you may never find that out as you try something, it does not make any measurable difference so you put it back to how it was without discovering taht it did in fact make a small improvement in performance which when coupled with lots of other small improvements can add up.

I have created a mini-tutorial which provides you with a high resolution timer (accurate to less than one millionth of a second - this depeneds on your PC) that will let you add this timer around code sections or psub/function calls that will allow you to get a very accurate timing of how long that code takes to execute and let you measure how a code change affects the speed of operation.

This timer can determine speed improvements in hundredths or less of a millisecond - so it is far better than trying to use the Timer() function to time code sections.

Please have a look at this mini-tutorial

Best regards,
Adrian



ModEdit - To learn how to write better performing programs see -> Tutorial - A Crash Course In Optimization