Crystal performance....HELP!

This kind of code is I/O bound. The CPU is waiting around for the responses and so just switching to a faster language won’t help.

Node.js has a pretty good model for dealing with code like this through its event loop. Crystal does as well with its concurrent fiber scheduler. That’s why you see similar performance between the two. If you tried something like Ruby or Python, you would see a much larger slowdown. I would suspect if you wrote your sample in Go (using goroutines for fibers), you would see similar performance as well.

1 Like