4 ms·
Ruby is fast in non-benchmark jobs like text processing. It's not ruby slow, it's sass's implementation of dependency analysis slow. Good compilers in Ruby, lik
by luikore 13y ago
Ruby is fast in non-benchmark jobs like text processing. It's not ruby slow, it's sass's implementation of dependency analysis slow. Good compilers in Ruby, like Slim is even faster than most template engines in Javascript or Go.
- pmr_ 13y agoCan you provide a source for the first statement? It seems unlikely to me that a language implementation is going to be fast on text processing which is essentially a aggregate task of what most benchmarks try to profile individually, but I could be missing something less obvious.
- luikore 13y agoRuby has many high level text operation abstractions, which is not included in most other languages. But in micro-benchmarks we need to ensure all the languages use the same algorithm, or similar code to do the job. Then the high level methods, which are usually better optimised, are usually forbidden. In the computer benchmark games (http://benchmarksgame.alioth.debian.org http://benchmarksgame.alioth.debian.org), most of the benchmarks are heavy on floating-point arithmetic or raw loops, which are completely not for the case of web applications. You can also see in text benchmarks like regex-dna, Ruby performs much faster. If you do benchmarks regardless the implementation details. You may find Ruby can be several times faster than Java in cases like AES encryptions: https://gist.github.com/luikore/7746976 https://gist.github.com/luikore/7746976 --- though this is not a valid micro-benchmark, it is in fact comparing JCE and OpenSSL. But this is what real-world programs do and the speed of calculating Mandelbrot sets or simulating n-body systems really doesn't matter.