5 ms·
What? It absolutely has to do with the language. Ruby binary trees: 57 seconds Scala binary trees: 11 seconds [1] - http://benchmarksgame.alioth.debian.org/u6
by joslin01 10y ago
What? It absolutely has to do with the language.
Ruby binary trees: 57 seconds
Scala binary trees: 11 seconds
[1] - http://benchmarksgame.alioth.debian.org/u64q/ruby.html http://benchmarksgame.alioth.debian.org/u64q/ruby.html
[2] - http://benchmarksgame.alioth.debian.org/u64q/scala.html http://benchmarksgame.alioth.debian.org/u64q/scala.html
- FooBarWidget 10y agoThat would mean something if Ruby apps are 100% Ruby and/or are performing binary tree operations all the time, or doing similar kinds of CPU-intensive operations as depicted in the alioth benchmarks. But they don't. Ruby web apps perform lots of string manipulation, memory allocation, I/O. A lot of expensive things are offloaded to C libraries. Things like XML parsing are offloaded to native libraries like libxml; nobody uses an XML parser fully implemented in Ruby. Ruby does not reimplemented gzip compression in Ruby, it uses zlib. So the alioth benchmarks are not representative of real-world performance.
- deleted 10y ago[deleted]
- igouy 10y ago>> Ruby web apps perform lots of string manipulation, memory allocation, I/O. << string manipulation http://benchmarksgame.alioth.debian.org/u64q/program.php?test=revcomp&lang=yarv&id=2 http://benchmarksgame.alioth.debian.org/u64q/program.php?tes... memory allocation http://benchmarksgame.alioth.debian.org/u64q/program.php?test=binarytrees&lang=yarv&id=1 http://benchmarksgame.alioth.debian.org/u64q/program.php?tes... I/O fasta, fasta-redux, reverse-complement write 250MB regex-dna reads 50MB; k-nucleotide, reverse-complement read 250MB >> …offloaded to native libraries… So the alioth benchmarks are not representative of real-world performance. << The benchmarks game does show C programs ;-) The benchmarks game does show scripting-languages explicitly using native libraries: http://benchmarksgame.alioth.debian.org/u64q/program.php?test=pidigits&lang=php&id=5 http://benchmarksgame.alioth.debian.org/u64q/program.php?tes...
- FooBarWidget 10y ago> string manipulation That benchmark performs string manipulations that rarely occur in web apps. Web apps need: concatenation, substring, find/replace, maybe with regexps. All of those are implemented in C. > memory allocation Web apps don't tend to implement entire trees in pure Ruby. That benchmark is completely non-representative of real-world performance. What exactly are you getting at? Of course it's easy to find a bunch of synthetic benchmarks that show weaknesses in particular cases. Still doesn't prove anything.
- igouy 10y ago> Web apps need: concatenation, substring, find/replace, maybe with regexps. All of those are implemented in C. join and gsub? http://benchmarksgame.alioth.debian.org/u64q/program.php?test=regexdna&lang=yarv&id=1 http://benchmarksgame.alioth.debian.org/u64q/program.php?tes... > Web apps don't tend to implement entire trees in pure Ruby. Nor do other apps but that is what Hans Boehm came up with as a simple GC benchmark. http://hboehm.info/gc/gc_bench/ http://hboehm.info/gc/gc_bench/ > What exactly are you getting at? You don't seem to know what is shown on the benchmarks game website.
- FooBarWidget 10y agoDoesn't your regex-dna benchmark kind of prove my point? Just look at the comparisons here: http://benchmarksgame.alioth.debian.org/u64q/performance.php?test=regexdna http://benchmarksgame.alioth.debian.org/u64q/performance.php... C GCC: 2.46 sec Java: 8.23 sec Ruby #8: 9.35 sec It's only about 4x slower than pure C in this case, and only a little slower than Java which has a very good JIT. > You don't seem to know what is shown on the benchmarks game website. How funny of you to say that while acting as if the benchmarks "prove" Ruby is the ultimate spawn of the devil that eats away any and all performance. The website itself tells you not to jump to conclusions and that the app itself is the ultimate benchmark: http://benchmarksgame.alioth.debian.org/dont-jump-to-conclusions.html http://benchmarksgame.alioth.debian.org/dont-jump-to-conclus...
- 10y ago