Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Mostly Ruby web app workloads aren't CPU-bound. And when they are, you're using a language that is 100 to 1000 times slower than C.

That is, for a CPU-bound task, you might be able to replace your thousand node k8s cluster with one machine running code written in a faster language (before even getting into communication and load balancing and HA and all that crap.)



But abandoning everything you've written in one language for the sake of a single hot path isn't really a good idea either.

It's probably a more sensible idea to use a native extension to optimize just that hot path. For instance, the Rust bindings are really good: https://github.com/tildeio/helix


Sometimes. If your profile is "lumpy" enough that can be true, but often the performance problems of slow languages manifest as annoyingly flat death-by-a-thousand-cuts profiles. (Especially after the low hanging fruit has been picked.)

Grinding another 5x out of a flat profile can be hard work requiring more creativity and producing less readable code than a (fairly mechanical) translation. Luckily these tasks also tend to crop up when design has stabilised and team sizes are increasing, meaning it can often coincide with the benefits of static typing becoming greater.

It's not a panacea, and it's obviously both risky and costly. Shrugs.

(I've also seen the other case, FWIW. Wrote some C extension code called from a Rails app, and it was the right call at the time and we got great mileage out of it.)


Crystal or Elixir allow for relatively less painful migration to high(er) performance overall.

But this is beyond the scope of the article.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: