jhawthorn / execjs-fastnode

:zap: A faster Node.JS integration for Ruby/Rails ExecJS
MIT License
51 stars 2 forks source link

Real world example #3

Closed dziulius closed 8 years ago

dziulius commented 8 years ago

In the real world applications using node.js is few times faster than using therubyracer.

What kind of benchmark do you use that shows opposite results?

jhawthorn commented 8 years ago

In the real world applications using node.js is few times faster than using therubyracer.

What do you mean? Do you have an example of this? node.js and therubyracer both use v8 so they should be pretty comparable.

The benchmark I am running tests compiling a small snippet of coffeescript. I think this is a pretty representative benchmark of how ExecJS is normally used. The results are in the README

dziulius commented 8 years ago

Coffeescript and friends is slowly going away. More and more applications use node based compilation toolkits. For example, we use https://github.com/shakacode/react_on_rails, which throws away few large files. In such case using nodejs is few times faster than therubyracer.

dziulius commented 8 years ago

So I did some benchmarking with our application. Testing method was time rake assets:precompile RAILS_ENV=production. And here are the results:

mini_racer - 1m39.754s fastnode - 1m57.029s node - 3m7.456s therubyracer - 8m38.923s

However, things get really interesting when I disable uglifier:

therubyracer - 0m22.335s node - 1m26.406s fastnode - 0m19.217s mini_racer - 0m21.340s