Bun vs Node.js Performance Comparison

Fibonacci

Calculation of Fibonacci(40) with a recursive algorithm. (Time in seconds)

Bun was faster for recursive Fibonacci calculation. It was about 1.62 times faster than Node.js.

About This Project

This project aims to compare the performance of Bun and Node.js across various aspects. There are benchmarks for different scenarios, including simple loops, recursive functions, reading/writing large files and too many small files, as a HTTP server and as a package manager.


Testing Process

  • All tests are automated using Bash scripts for environment preparation, test execution, system usage monitoring, and report generation.
  • Each test scenario includes a warm-up phase (not included in results) followed by 100 iterations for both Bun and Node.js.
  • Tests are run sequentially to prevent interference.

For more details, visit the GitHub repository.