I have been playing around with Node.js on BalenaOS vs Raspbian, and I was impressed with the difference in performance. In fact, I am controlling a hardware system using Node.js + Express. I am using two different environments, one for testing and one for production:
- Test environment: Raspbian Stretch
- Production environment: Balena OS
I have been running a few tests on the same function when run on two different environments on the same hardware (I am swapping SD cards in and out of a RPI 3b+). These are the results:
- Test environment ==> avg time: 34.479 ms
- Production environment ==> avg time: 0.662 ms
The code being used is exactly the same. Both tests run through the same docker-compose file. Why is there such a big difference?