4 ms·
Performance varies a lot in Racket-on-Chez. For some programs, such as tight loops over simple data, Chez provides a lot of the same benefit as Pycket, but Pyck
by samth 8y ago
Performance varies a lot in Racket-on-Chez. For some programs, such as tight loops over simple data, Chez provides a lot of the same benefit as Pycket, but Pycket is often still faster. Here's a simple loop that sums numbers from 1 to 100000000, with timings for all three variants of Racket:
[samth@huor:~/sw/plt (master) plt] pycket-c -t count.rkt
cpu time: 83 real time: 83 gc time: 0
4999999950000000
[samth@huor:~/sw/plt (master) plt] racket -t count.rkt
cpu time: 226 real time: 227 gc time: 0
4999999950000000
[samth@huor:~/sw/plt (master) plt] racketcs -t count.rkt
cpu time: 170 real time: 174 gc time: 2
4999999950000000
Chez is faster than regular Racket, but not as fast as Pycket.
However, other programs the difference is much bigger. If we use generic iteration instead of type-specializing it, we get these numbers:
[samth@huor:~/sw/plt (master) plt] racket -t count.rkt
cpu time: 2883 real time: 2882 gc time: 0
4999999950000000
[samth@huor:~/sw/plt (master) plt] racketcs -t count.rkt
cpu time: 1266 real time: 1266 gc time: 0
4999999950000000
[samth@huor:~/sw/plt (master) plt] pycket-c -t count.rkt
cpu time: 74 real time: 74 gc time: 0
4999999950000000
Finally, on programs with contracts and gradual types, one of our focuses for Pycket, Racket-on-Chez is currently substantially slower than the current Racket VM.
- samth 8y agoSource code here: https://gist.github.com/92ed7836508fe15b1e58f840a8d3a534 https://gist.github.com/92ed7836508fe15b1e58f840a8d3a534
- eggy 8y agoThank you so much for all of that! I'll have to look over this in the coming weekend. It's efforts such as these that keep me coming back to Racket again and again.