Yesterday I just downloaded crystal and ruby and compared the performance between them with the simple hello program. I am expecting crystal is much faster than Ruby, however it shows crystal is much slower than Ruby 3.0.
macOS Big Sur 11.2.3 @ iMac
Processor: 3.4 GHz Quad-Core Intel Core i5
Memory: 32 GB 2400 MHz DDR4
You’re including the compilation time of the crystal program in your comparison. A more fair comparison would be like: crystal build --release hello.cr && time ./hello.
It’s also worth noting that simple hello world performance is far away from any real-world use cases and such a small program that any benchmark is easily derailed by any kind of external factors.
And I wouldn’t expect there to be much of a performance difference between Crystal and Ruby if you print hello world in a loop. The bottleneck is probably IO (i.e. how fast you can write to the console) for both.