KarolS/millfork

Performance drop. array(byte) Vs. array(bool)

zbyti opened this issue · 6 comments

zbyti commented

When we use array(bool) instead of array(byte) in sieve 1899 benchmark we have performance drop.

java -jar millfork.jar --version
millfork version 0.3.18

java -jar $HOME/Programs/Millfork/millfork.jar -Xr -t a8 sieve1899.mfk
less is better
586 jiffies - array(byte)
680 jiffies - array(bool)

Millfork-sieve1899.zip

I noticed that this fixed itself somewhere along the way and the bool version is now as fast as the byte version.

zbyti commented

I don't agree. Still 680 frames with bool in new Millfork.

atari000

zbyti commented

re-open please :]

It turned out that I compiled sieve1899-byte.mfk to sieve1899-bool.xex and that's why I thought it works fine. Oops!

I found few reasons why it didn't optimize, fixed them and now the bool version should be faster than the byte version (although that's only because you're doing == 1 instead of != 0)

zbyti commented

Those were my beginnings with Millfork, now I usually remember about != 0 ;)

It's great to hear that bool is just as fast because I'm preparing a suite for Millfork identical to: https://github.com/zbyti/a8-mad-pascal-bench-suite

zbyti commented

For Mad Pascal I provided version with !=0 https://github.com/tebe6502/Mad-Pascal/blob/master/benchmark.7z and Millfork reach 579 frames, two more then MP. .bat files in this archive are not mine.