NectarJS vs NodeJS Fibonacci Benchmark on Raspberry PI 3

Today, I want to show you some fun with NectarJS : compilation and benchmark on Raspberry PI 3. I will oppose NectarJS to NodeJS for a Fibonacci recursive function.

Support NectarJS on KickStarter

The video

The code

function fibonacci(n)
{
  if (n < 2)  return n;
  return fibonacci(n - 2) + fibonacci(n - 1);
}
console.log(fibonacci(30));

Testing

Testing with NodeJS :

time node fibo.js

Testing with NectarJS (compilation + execution time) :

time nectar --run --single -o nectar-fibo.bin fibo.js

Testing with NectarJS (execution time only)

time ./nectar-fibo-bin

Results

Engine / Compiler Result
NodeJS 17.937s
NectarJS - compilation + execution 6.783s
NectarJS - execution 5.719s

Support NectarJS on KickStarter

Adrien