Gadz-Geek Blog

The blog of a Gadz Geek.

Benchmarking the Performance of Nodejs

During the course of developing node-opcua, a javascript framework for OPCUA powered by nodejs, I came across the need to measure the performance of nodejs on various hardware including ARM based nano-computers such as RasberryPi and BeagleBoneBlack.

Understanding the performance of the V8 engine used by nodejs.

Nodejs is using Google V8 javascript engine which runs inside the Chrome web browser too.

V8 code optimisation can lead to astonishing good results compared with C/C++ program, at least on a x86/x64 processor.

But ...

  • Does V8 inside nodejs perform as well as in Chrome ?
  • Is V8 performing well also on ARM CPU ?
  • How does nodejs running on a Raspberry compare with nodejs running on an BeagleBoneBlack ?

Here comes Octane 2, a benchmark to score the performance of a javascript engine running inside a browser designed by Google.

You can run the benchmark inside your browser by following this link and pressing the START button.

Here are the results with Chrome and Firefox on my desktop:

Computer environment Score Javascript Engine
Core I7 desktop Chrome (36.0.1985.143) 26008 V8 v3.26(*)
Core I7 desktop Firefox 31 15800 SpiderMonkey 31
VM Ubuntu 14.04(*) Chromium (36.0.1985.125) 8178 V8 3.26
VM Ubuntu 14.04(*) Firefox 31 5041 SpiderMonkey 31

(*) Ubuntu 14.04 running inside a VirtualBox machine on my Core I7 desktop.

However, I needed the same benchmark but running on nodejs , without a GUI. Fortunately, octane benches are pure javascript algorithms and can be easily ported to node. Daishi Kato has published benchmark-octane a NPM module on github that serves as a very good starting point.

With a few tweaks I created a forked version of benchmark-octane that suites my need.

This version produces the same output as the browser version making results more comparable.

This is the result of running benchmark-octane on various version of node:

Running Octane benchmark for nodejs:

Computer environment Score time
Core I7 desktop nodejs 0.10.24 15800 50s
Raspberry nodejs 0.10.24 138 2351 s
VM Ubuntu 14.04 nodejs 0.08.21 5600 74s
VM Ubuntu 14.04 nodejs 0.10.10 6550 62s
VM Ubuntu 14.04 nodejs 0.10.24 6472 62s
VM Ubuntu 14.04 nodejs 0.10.31 (crashed in Mandreel)
VM Ubuntu 14.04 nodejs 0.11.13 8050 50s

running NodeJS Benchmark

$ npm install benchmark-octane -g
$ benchmark-octane
  • What's about you ?
  • Can you tell me the octane score you get with you hardware and nodejs version ?
  • Do you also experiment a crash with nodejs 0.10.31 ?