|
|
|
|
|
by vidarh
3379 days ago
|
|
70x faster, with the caveat that the way that Ruby code is written really does not lend itself to speed. E.g. using method calls inside the class instead of accessing instance variables instantly springs to mind, as does the "unsorted priority queue" which is basically a horrible abuse of Array but wrapped in a class that makes it even slower by adding additional method calls for every operation. That's not to diminish the speedup Crystal gets, because it does illustrate how slow MRI's method calls are, but it'd be interesting in seeing a comparison with an astar implementation that was actually written to be fast in Ruby. Also would be very interesting to see a comparison with jRuby+Truffle, of course. |
|
The point of the article was merely "How much work does it take to port Ruby to Crystal" The performance differences were just fun to see, not the intent.
If I get time, maybe I'll run this through jRuby+Truffle as a comparison, that would be interesting to see.
[1] https://github.com/SteveRabin/JPSPlusWithGoalBounding