Hacker News new | ask | show | jobs
by vengefulduck 1296 days ago
Your kidding right? Anything IO bound like an server isn’t going to be remotely affected by the speed of underlying language. There’s almost no compute required for a mastodon server just take HTTP requests and store and retrieve data from a database. The CPU is going to be active for a fraction of a millisecond before it becomes blocked on either the database or network.
4 comments

You’d be surprised at how brutally inefficient RoR code actually is. Anyway, ActivityPub is a protocol, and Mastodon isn’t relevant for this discussion.
Hard disagree. Friendly programming languages such as Python and Ruby on Rails are good for small applications but when applications grow, so does their footprint.

You can get equivalent performance through more work, more caching layers, more servers and more hardware resources, but there's a real limit to how much one server can handle before it starts slowing down.

The simple fact is that a a Bash web server will never be as fast as a bespoke x64 assembly HTTP server. There's a huge gradient between the two and I'm not suggesting we need to build a Mastodon backend in C, but this "it's a web server so who cares about performance" approach to programming languages needs to go.

Take a look at the techempower listing if you don't believe me. Ignore the weird, bespoke, benchmark oriented servers and focus on real world applications if you wish to make the gap smaller but even among big frameworks you'll find the differences. JSON serialisation is one example every web API needs to deal with, and ASP.NET stands head and shoulders above Ruby on Rails performance, for example.

In practice, there's probably no real performance difference between the JVM, dotnet, and Rust frameworks because of I/O limitations. However, Ruby on Rails lives in a whole different performance segment, next to PHP and Python.

You are wrong. Web applications written in languages like Python or Ruby will spend most of their time spinning the CPU instead of retrieving stuff from the database. There are languages that are just that slow.
Benchmarks disagree with you. Ruby is 6x slower than Java/Rust/Scala for a basic web server.

https://www.techempower.com/benchmarks/#section=data-r21&tes...

There is a reason Twitter switched from Ruby to Scala during their fail-whale era.