Settings

Theme

Raybench – Crystal Programming Language

eccentricdevelopments.com

1 points by binki89 9 years ago · 1 comment

Reader

binki89OP 9 years ago

In terms of performance, I was able to reduce the computational time from 1m57.812s to 0m30.203s (25.6% of the original time) on my 2.8 GHz 16 GB memory machine simply by changing each 'class' to a 'struct'. The difference is that structs are allocated on the stack in Crystal. This is a common performance optimization in Crystal (https://crystal-lang.org/docs/guides/performance.html). For comparison, the Go code, also listed on the site, ran on my machine in 1m22.466s. I think that with the use of structs instead of classes, Crystal does run very similar to C speeds. Otherwise, I really enjoyed this article. The author compares several other languages with the same benchmark (see http://www.eccentricdevelopments.com/programming-language-co...). It would be interesting to see D-lang in a future comparison.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection