Re:Pycket: A Tracing JIT For a Functional Language (2015) [pdf]
by samth on Tuesday September 18, 2018 @12:07PM
(#18016412)
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.
However, other programs the difference is much bigger. If we use generic iteration instead of type-specializing it, we get these numbers:
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.