2 ms·
This is a pretty basic benchmark, but there are more robust ones for Crystal and others here: https://www.techempower.com/benchmarks/ https://www.techempower.co
by awb 6y ago
This is a pretty basic benchmark, but there are more robust ones for Crystal and others here: https://www.techempower.com/benchmarks/ https://www.techempower.com/benchmarks/
Under Filters you can select the languages / frameworks that are of interest to you. For example Go seems to have several implementations that beat Crystal: https://www.techempower.com/benchmarks/#section=data-r19&hw=ph&test=fortune&l=zdjvnj-1r https://www.techempower.com/benchmarks/#section=data-r19&hw=...
Having programmed in both though, I far prefer the language / idea of Crystal for innovation. But it is hard to beat the performance and explicit nature of Go for production applications.
- throwaway894345 6y agoThe non-recursive Go fibonacci implementation computes in ~160ms and uses only 1.5mb on my MacBookPro (and I can get the binary size down to 850K by stripping symbols and using the println builtin instead of fmt.Println). This microbenchmark seems to tell us more about function call overhead than it does about typical application performance. Further, while I don't doubt that Crystal binary sizes are smaller in general, I don't think we can get much information about binary sizes from these micro-toy-sized programs. For example, the Go version shaved off a full mb by using the `println` builtin rather than `fmt.Println`, probably because the former pulls in more of the runtime than the latter. These toy benchmarks are very sensitive to these kinds of things, and the size of the runtime is going to be a trivial portion of the size of any real application anyway.