Re: Compiler Speed Trials
Well a command line option there, or a #define works as well for a ROM print version.
boriel wrote:Now this REALLY needs intensive testing (array and FOR...NEXT loops). I'm uploading a new 1.2.6 beta-r1571, if someone is interested.
britlion wrote:Just ran the BM 7 and BM8 tests on the latest test build with -O3.
BM 8 is still sitting the same (and -O3 made no change), but BM7. Wow.
1.10 seconds unoptimized, and 0.94 seconds with -O3 added to the mix.
Boriel, the changes to the array handling stuff have made an enormous difference; and the loop code improvement can't have hurt any. Way to go!
This is what I like to see in a tool that can use the PC's memory space to pull in optimizations and options that could NEVER have fit onto the spectrum itself.
While technically still not quite the fastest array handling of the compilers, still maintaining the far more versatile array options AND halving the time taken is a pretty impressive feat.
britlion wrote:This does raise a question, Boriel:
Could the compiler recognize a case of dealing with, say, a one dimensional array, and handle that completely differently - say by hanging onto the index in a register (or register pair)? The overwhelming majority of arrays are one dimensional - and it's of course possible in a cross-compiler to build in optimized options for different cases. (we don't have the memory limit for this sort of thing we have for an on-spectrum compiler!)
Sure, if someone wants an 8 dimensional array, good luck to them - the compiler handles that. (Which is utterly staggering, by the way. This is the most flexible compiler for the spectrum by far!). But, having said that, since probably 90% of arrays are single dimension, I'd say the possibility of making that a special case the compiler creates the tightest code for, might be worthwhile.
britlion wrote:How is that wanting the /language/ to change to a lower level syntax? In each case the syntax is DIM a(5) or DIM a(5,3,4,3) - I want the compiler to be smarter; not the language syntax to be more complex!
BM1 BM2 BM3 BM4 BM5 BM6 BM7 BM8
Sinclair 4.46 8.46 21.56 19.82 25.34 60.82 87.44 23.30
ZIP 1 .5 0.031 0.064 0.194 0.108 0.115 0.29 0.46 *
TOBOS 0.58 0.82 2.02 1.76 2.34 6.68 8.72 0.746
Hisoft Basic
Integer Optimized 0.026 0.042 0.67 0.08 0.088 0.334 0.50 10.76
Boriel's ZX BASIC 0.038 0.032 0.30 0.15 0.16 0.328 2.20 24.0
ZX Basic 1.26 -O3 2.12 20.78
ZX Basic 1.26-r1603 -O3 0.94 20.78 (17.14 with fSin)
ZX Basic 1.2.8-r2153 -O3 1.36 29.06 (24.18 with fSin)
BM1 BM2 BM3 BM4 BM5 BM6 BM7 BM8
Sinclair 4.46 8.46 21.56 19.82 25.34 60.82 87.44 23.30
TOBOS 0.58 0.82 2.02 1.76 2.34 6.68 8.72 0.746
Hisoft Basic
Integer Optimized 0.026 0.042 0.67 0.08 0.088 0.334 0.50 10.76
Boriel's ZX BASIC 0.038 0.032 0.30 0.15 0.16 0.328 2.20 24.0
ZX Basic 1.26 -O3 2.12 20.78
ZX Basic 1.26-r1603 -O3 0.94 20.78 (17.14 with fSin)
ZX Basic 1.2.8-r2153 -O3 1.36 29.06 (24.18 with fSin)
ZX Basic 1.2.8-r573 -O3 1.32 29.06 (fails to compile with fSin)
BM1 BM2 BM3 BM4 BM5 BM6 BM7 BM8
Sinclair 4.46 8.46 21.56 19.82 25.34 60.82 87.44 23.30
ZX Basic 1.26 -O3 2.12 20.78
ZX Basic 1.26-r1603 -O3 0.94 20.78 (17.14 with fSin)
ZX Basic 1.2.8-r2153 -O3 1.36 29.06 (24.18 with fSin)
ZX Basic 1.2.8-r573 -O3 1.32 29.06 (fails to compile with fSin)
ZX Basic 1.2.8-s620 -O3 1.32 29.00 (Does not compile with fSin)
britlion wrote:Here's the latest version (seems to be 573? Odd numbering!)
This latest version improves on the last, but not in the BM8 trial. It also fails to compile the fSin function with the error:
Traceback (most recent call last):
File "zxb.py", line 312, in <module>
File "zxb.py", line 265, in main
File "backend\__init__.pyc", line 2386, in emmit
File "backend\__init__.pyc", line 926, in _cast
NameError: global name '_fixed_oper' is not defined
BM1 BM2 BM3 BM4 BM5 BM6 BM7 BM8
Sinclair 4.46 8.46 21.56 19.82 25.34 60.82 87.44 23.30
ZX Basic 1.26 -O3 2.12 20.78
ZX Basic 1.26-r1603 -O3 0.94 20.78 (17.14 with fSin)
ZX Basic 1.26-r1812 -O3 1.36 29.00 (24.22 with fSin)
ZX Basic 1.2.8-r2153 -O3 1.36 29.06 (24.18 with fSin)
ZX Basic 1.2.8-s644 -O3 1.32 29.00 (24.22 with fSin)
britlion wrote:New benchmarks with 1.2.8.s644. 1.26-r1603 is still the speed king for ZX Basic. Hisoft fastest overall.
Just for curiosity, I downloaded the "legacy" version on the website. It's version r1812. This also shows the slowdown, if you are trying to track when this happened.
Boriel, do you still have the code available to wind it back to 1.26-r1603?
- Code:
BM1 BM2 BM3 BM4 BM5 BM6 BM7 BM8
Sinclair 4.46 8.46 21.56 19.82 25.34 60.82 87.44 23.30
ZX Basic 1.26 -O3 2.12 20.78
ZX Basic 1.26-r1603 -O3 0.94 20.78 (17.14 with fSin)
ZX Basic 1.26-r1812 -O3 1.36 29.00 (24.22 with fSin)
ZX Basic 1.2.8-r2153 -O3 1.36 29.06 (24.18 with fSin)
ZX Basic 1.2.8-s644 -O3 1.32 29.00 (24.22 with fSin)
Users browsing this forum: No registered users and 2 guests