I guess it depends, for one-off tasks you'll have to compile and run the Crystal code. I assume you ran the code above with `crystal run`. If you first compile the code with `crystal build --release` and run it, you should see a dramatic improvement over Ruby.
On my machine, parsing a 374MB file took:
- 25.63 using Ruby
- 19.97 using Crystal (run w/o optimizations)
- 19.01 using Crystal (compiled w/o optimizations)
- 18.68 using Crystal (run w/ `--release` flag)
- 11.54 using Crystal (compiled w/ `--release` flag)
This isn't a benchmark that I'd expect to see a significant difference in. The majority of the CPU work is in the regular expression, and Ruby's regex engine is implemented in C.