I've built an application on Node.js and works instantly (in 300 ms) on Core i7 processor, Debian Scratch. When I try to run the same application on Raspberry, startup time is 7.2 seconds!.

While debugging, I understand that all waiting takes place on require lines. It comes to this point:

$ touch test.js
$ time node test.js 

real    0m0.930s
user    0m0.820s
sys     0m0.100s

The startup time is pretty much. Here is more timings:

// --------------------------  // startup time: 0.95 seconds
var _ = require('prelude-ls'); // adds 0.05 seconds
var io = require('socket.io'); // adds 2.20 seconds 
var Hapi = require('hapi');    // adds 4.00 seconds 
var zmq = require('zmq');      // adds 0.13 seconds 

Is it because of these two libraries, or is there anything to do with Node.js on Raspberry?

Node.js version is v0.12.6


By the way, top says Node.js consumes 103% of CPU power in these tests.

  • Your Core i7 has a clock speed several times that of the pi, and an architecture that does more per clock cycle. Additionally, it has limited memory and slooow I/O. Chances are the module files were cached in memory on your Debian system if you had run the program recently,while on the Pi, they were most likely read from SD each time. I'm not sure this explains the entire gap, but you shouldn't expect comparable performance between those two systems.
    – TomG
    Aug 17, 2015 at 2:59
  • Of course I don't compare two systems :D But there is no performance difference with my other project, written in Python, on both systems. The Python codes both start instantly. What I meant by giving that "300ms" is to say: "There is no blocking/waiting code in my application"
    – ceremcem
    Aug 17, 2015 at 8:55
  • Are you trying to say you have a python script that runs in the exact same time on the pi as on an i7? What does it do, nothing? I just don't believe you. Everything on the pi is going to be much slower than an i7. As others have mentioned, 20x slower in this case is not at all surprising...
    – goldilocks
    Aug 17, 2015 at 10:44
  • ..The total Ghz/Mhz is not the only factor. That Intel x86_64 chip is considerably more efficient, clock cycle for clock cycle, than the 32-bit Broadcom ARM chip, because it has a more advanced instruction set and more advanced hardware optimizations. ARM architectures are optimized for power (as in, to consume less of it) and cost, not speed. I dunno how much a BCM2835 is to buy on its own, but I'd guess not more than $10. Sometimes you get what you pay for.
    – goldilocks
    Aug 17, 2015 at 10:52
  • 1
    @goldilocks On Raspberry, this project has no sensible performance difference. But Node.js has. That's all I said. If a hardware is slow, then it slows down whole operations. Not just Node.js'... Node imports these 4 modules in 300 ms on i7 core, 7.2 seconds on raspberry. Importing all modules (from aktos_dcs import *) in python takes 190 ms on i7, 850 ms on Raspberry. Don't believe me, just do the math.
    – ceremcem
    Aug 17, 2015 at 18:47

1 Answer 1


I would run some more checks against node version 0.10 as hapi doesn't officially support version 0.12. There is some performance regression in version 0.12 that you maybe hitting.

  • 1
    I installed v0.10.33 and above overall timing decreased from 7.2 seconds to 6.1 seconds; but this is also not acceptable.
    – ceremcem
    Aug 16, 2015 at 13:19
  • There maybe some memory leak within your app.
    – simon-p-r
    Aug 16, 2015 at 13:51
  • 1
    The four lines in my question is all the code I tested. There was no more code.
    – ceremcem
    Aug 16, 2015 at 14:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.