Like last the last time we did this (back in 2012) this was provoked by a conversation in an unreleated thread, with some of the same people.
He provided source code for me to run on RISC OS under BBC BASIC for the first entry. Unfortunately it is going to take some time to get it running as it breaks the rule that all commands, statements, and directives in BBC BASIC must be upercase, as well as breaking the rules for line numbers when saved in text form. Would be nice if he provided a tokenized version (as BBC BASIC for SDL also uses the same tokenized source file format as BBC BASIC V).
Now the main point of the thread:
Lets see what completely interpreted language provides the fastest performance in a few differnt tests. We will compare them regardless of the operating System on which they run.
For test results running on BCM2835 based Raspberry Pi computers the CPU clock is expected to be 1000MHz, and the other clocks as default. Results on the RPi Zero must be specified so do to the different SDRAM and GPU clock settings.
For test results run on BCM2837 based Raspberry Pi computers the clocks are assumed to be the default settings for the particular Raspberry Pi.
So lets get to it. The challenges recommended are (this list will grow):
- Simple Fibonocci implemented using recursive algorithm (everything fits in unsigned 32-bit integers).
- Simple Fibonocci implemented using the fast algorithm (everything fits in unsigned 32-bit integers).
- Simple Prime Seive (again everything fitting in unsigned 32-bit integers).
For those that do not know, and are using a language a definition of a value that fits into a 32-bit unsigned integer is: An integer greater than or equal to 0 and less than 2 to the 32nd power, that is an integer whose value is n where n is:
Code: Select all
0 <= n < 4294967296
Also Heater has me running an insane extremely large number Fibo test, so results for that in other interpreted languages are welcome.
EDIT 1: Corrected the error of omitting the word unsigned. Unsigned now specified where needed. Also added definition for 32-bit unsigned integer, for those that do not know and are working in a languge that provides for arbitrary percision.