Hi Toro's Sieve test

BlitzMax Forums/BlitzMax Programming/Hi Toro's Sieve test

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

You're right. The difference is slight on debug builds, but it doubles the execution time on release builds.

Looking at the .s code generated, you can see that when locals are used all the variables are kept in the processor registers. When globals are used, the variables have to be pulled in and pushed out of main memory each time.

Chances are that an intelligent C compiler would realise that you can fit all of the variables in processor registers and optimise accordingly. If you create a few more local and global variables in the C test, it might have to start storing them in RAM too.