RiscLua/BASIC/C Comparison
Daryl Dudey (2012) 55 posts |
Has anybody done a rough comparison of performance across these? I know performance doesn’t matter THAT much, but curious really as to how RiscLua compares to BASIC in particular which is highly optimised for ARM. I also know I could do this myself, but I guess I’m feeling lazy and if somebody has already done it, bazinga! |
GavinWraith (26) 1563 posts |
Comparing BASIC and C is relatively straightforward because they do things in much the same way. Strings, for example, are stored as arrays of bytes in both languages. But RiscLua-strings are not – they are immutable objects, and are realized as a quite different datatype. This makes many comparison benchmarks somewhat dubious. String-comparison in RiscLua takes only microseconds; all that is happening internally is a comparison of two pointers, and the size of the strings are irrelevant. It is string-creation that takes longer in RiscLua, because every new string has to be compared with the strings defined already in the given environment before it can be determined whether a new hash-value is required for it. And these differences apply not just to strings but to functions and other kinds of object. So formal comparisons of performance depend strongly on the algorithms used. But this is not what you are asking for, I know. My informal impression is that RiscLua is somewhat faster than BASIC overall, but considerably slower than C. As always, it depends on the job. |
nemo (145) 2546 posts |
Basic is interpreted, but tokenised and with a modest amount of caching. That will be your performance ordering in all but the most contrived of cases. |
Daryl Dudey (2012) 55 posts |
Thanks, I appreciate the feedback! BTW, I heard at the London show news of Python 3.7 and GCC8. I presume these are still mostly unavailable? |