Website says "The majority of web applications handle far less than 1000 requests per second."
The benchmark provided (TechEmpower Benchmark) measure the amount of requests served, but these requests are for rather easy tasks like fetching data from a SQL database and serving it. Or doing JSON serialization.
Drop in a more alghoritmically-complex and/or general-purpose task (say, compress this file using GZIP before saving it on your server), and then you will feel the speed (or slowness) of your platform. And here perhaps you couln't hit the magical "1000 requests per second" benchmark.
Objectively, Ruby implementations (on the canonical Ruby MRI implementation) are slow. Sometimes even 100x slower than C.
Taking a deep look at these graphs, where 1x is C's performance under GCC:
Looking at the graph is revelaing, but in any case, for other dynamically-typed, dynamically-linked languages, here are other typical figures for comparison (from the graph, relative to C/GCC, lower numbers better).
Ruby MRI* 20x to 50x
Python 3 Similar to Ruby MRI
Racket 6x to 12x
ECMAscript (Node.js/V8) 7x to 10x
Common Lisp (SBCL compiler) 2x to 5x
For statically-typed languages:
Haskell (GHC) 2x to 9x
Java (latest official JVM) 1.5x to 3x
Swift and Go similar to Java
C# (under .NET Core latest) similar to Java
Rust <1x to 2x
C++ (g++ compiler) equal to slightly slower than C
C under GCC 1x
* JRuby, as the graph can show, doesn't help too much, and sometimes can be 2x to 7x slower than Ruby MRI!
At the end, for Ruby I would take the similar stance I would take with Python --- if I use it, it's because I like it. For example, I like using Python better than Js(under Node.js).
However if i was building a system that will demand performance, i'd look to other languages/implementations.
As-it-says - "the fastest written in any of the programming languages" - and currently those fastest programs are written in C, C++, Chapel, Fortran, Rust.
You've been led astray by the benchmarks. The reality is it's literally as fast as C because you're just hooking out to zlib.
It's much better to think of Ruby as a Smalltalk like high level language used to glue together lower level high performance building blocks.
Looking at things from this angle we see the typical Rails arrangement is actually business logic written in a high level language calling a bunch of native libraries eg. application server (Unicorn), HTTP parsing (Raygel parser), JSON parsing/generation (oj), HTML parsing/generation (nokogiri), DB client (pg).
Fun fact: MRI is actually designed more around memory efficiency than speed, because it's major funders are Japanese automobile companies, and Heroku; who (apparently?) care more (sometimes way more) about memory.
It's also (apparently) why MRI has such a fast startup time compared to similar languages and other Ruby implementations.
Yes, but take a look at the memory usage benchmarks (on the cited benchmarks) and Ruby is similar to Java's JVM on memory usage, sometimes better, sometimes worse.
You would need to compare "toy program" by "toy program", but for example, for the regex-redux program:
The benchmark provided (TechEmpower Benchmark) measure the amount of requests served, but these requests are for rather easy tasks like fetching data from a SQL database and serving it. Or doing JSON serialization.
Drop in a more alghoritmically-complex and/or general-purpose task (say, compress this file using GZIP before saving it on your server), and then you will feel the speed (or slowness) of your platform. And here perhaps you couln't hit the magical "1000 requests per second" benchmark.
Objectively, Ruby implementations (on the canonical Ruby MRI implementation) are slow. Sometimes even 100x slower than C.
Taking a deep look at these graphs, where 1x is C's performance under GCC:
http://benchmarksgame.alioth.debian.org/u64q/which-programs-...
Ruby MRI is typically 20x to 50x slower than C.
Looking at the graph is revelaing, but in any case, for other dynamically-typed, dynamically-linked languages, here are other typical figures for comparison (from the graph, relative to C/GCC, lower numbers better).
For statically-typed languages: * JRuby, as the graph can show, doesn't help too much, and sometimes can be 2x to 7x slower than Ruby MRI!http://benchmarksgame.alioth.debian.org/u64q/compare.php?lan...
At the end, for Ruby I would take the similar stance I would take with Python --- if I use it, it's because I like it. For example, I like using Python better than Js(under Node.js).
However if i was building a system that will demand performance, i'd look to other languages/implementations.