Contents / Part 3 / Previous chapter / Next chapter / Index
For some applications it is important that a program runs as quickly as possible and a few tips are given here which will, together, substantially increase the execution speed of programs. In other applications space may be at a premium and other suggestions are given for saving spree. Sometimes there is a trade off between the size of a program and speed and the user will have to decide which is more important.
The most dramatic saving that can be made is in the speed of execution of programs. The use of integer variables (e.g. WEIGHT%), and especially of the resident integer variables A% to Z% will result in execution times as little as 50% of those achieved with "real" variables. Again, integer division (DIV) is much faster than normal division when working with integers. Using integer arrays rather than real arrays will save 20% of the memory required.
Execution speed can also be increased in the following ways.
As far as space saving is concerned the following can be tried - but all reduce the readability of programs and should not be used unless it is really necessary./li>
Y=FRED OR MARY
In the latter case the computer will look for the variable FREDORMARY rather than the two variables FRED and MARY. The space after OR is not required./li>
The BBC Microcomputer User Guide was written by John Coll and edited by David Allen for the British Broadcasting Corporation.
Optical character recognition and original formatting effort by Mark Usher.
HTML version maintained by: Kade "Archer" Hansson; e-mail: firstname.lastname@example.org
Last updated: Monday 12th February 2001