Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 09:05 15 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : CMM2 - speed optimisation notes

Author Message
jirsoft

Guru

Joined: 18/09/2020
Location: Czech Republic
Posts: 533
Posted: 09:46pm 04 Nov 2020
Copy link to clipboard 
Print this post

Hi all,
while working on emulator, where I need maximum speed, I found until now fow points/ideas, which could be usable by others too (Peter knows it, but I didn't find it anywhere written)...

1. Hex constant are faster than decimal, with exception of negative numbers. So p = p + &h1 is faster than p = p + 1 (Also spaces make it a little bit slower, but not so much)
2. CSUBs are called faster when defined without parameters also in case they are defined (and needed) in C-file

CSUB action
...
END CSUB

Then called as action par1, par2
3. Logical functions are fast, mainly in combination with hex constants
4. Computed propertities faster then IFs
zero = (x = &h0)<<&h1
is faster than
IF x=0 THEN zero=2 ELSE zero=0

5. BYTE access into memory reserved as array is faster with help if LONGSTRINGs than PEEKs/POKEs, but marginally and not so cozy




Not so many, but maybe good start for quick guide...
Jiri
Napoleon Commander and SimplEd for CMM2 (GitHub),  CMM2.fun
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025