At the beginning of 2022, I published a series of articles about a
Crystal implementation for the Monkey Langauge.
I’m happy to report that My implementation compiled with Crystal 1.6.2 is much faster than the Go Version.
In the last episode, we wrote a TypeScript implementation for the Monkey Language.
Let's review some numbers, shall we?
Since I started this series, most languages and runtimes have released new versions. On the other hand, I did some...
Update: Dec 23 2022:
@jgaskins gave me a good Christmas gift, and now Crystal 1.6.2 is faster in both Interpreted and VM modes than Go 1.19. I’ll write an update on my blog
Thanks so much for that writeup! It’s great to see benchmarks for something more broad than synthetic math things.
Just a nit, it’d be great if the post had some pretty graphs to summarize the results. It’s a little hard to follow with just the raw data spread across a few different embeds.
That is a good idea. Let me see what I can do about it
I can recommend hyperfine for some easy benchmarking. It can output JSON data that can be used to make boxplots. Also the “time” command can be used to show the max RSS of a process (which I’ve found to be impressively low in my Crystal programs, although they’re mostly just toys and Advent of Code solutions).
a PR with a couple small tweaks to get the Crystal VM implementation to be slightly faster than its counterpart in Go.
I’m using hyperfine already but just the plain output. I’ll have a look into the other output options
Thanks for your contribution. I’ll have a look.
I think that I can squeeze a little bit of performance in the interpreter as well
I tested on a Linux VM with an AMD Ryzen, and Crystal 1.6.2 (with
@jgaskins changes) is faster than Go 1.19 but slower than Go 1.17 (Not for much).
I guess that Go had a performance regression between 1.18 and 1.19, 1.18 being the version where they introduced Generics.