Analysis and Experimental Comparison of the Performance of Modern JavaScript Runtime Environments for Server Applications
Note: This repository is part of a Master's thesis research project focused on analyzing and comparing the performance characteristics of modern JavaScript runtime environments for server applications.
This project contains benchmark API endpoints implemented in three different JavaScript runtimes:
- Node.js (with Express)
- Deno
- Bun
Each runtime implements the following endpoints:
- Latency / Response Time:
GET /ping - CPU Load:
GET /compute - Memory Usage:
GET /memory - Throughput Test:
GET /bulk
All servers listen on port 3000 and return JSON responses for consistent measurement.
This project uses specific versions of each runtime:
- Node.js: see
.nvmrcfile - Deno: see
.deno-versionfile - Bun: see
.bun-versionfile
# Install nvm if you don't have it
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc # or ~/.zshrc if using zsh
# Install and use the Node.js version specified in .nvmrc
nvm install
nvm use# Install Deno if you don't have it
curl -fsSL https://deno.land/install.sh | sh
# For a specific version (2.1.10)
curl -fsSL https://deno.land/install.sh | sh -s v2.1.10
# Check version
deno --version# Install Bun if you don't have it
curl -fsSL https://bun.sh/install | bash
# For a specific version (1.2.9)
curl -fsSL https://bun.sh/install | bash -s "bun-v1.2.9"
# Check version
bun --versionnpm run start:nodenpm run start:denonpm run start:bunThis project includes configurations for several popular performance measurement tools:
k6 is an open-source load testing tool that makes performance testing easy and productive for engineering teams.
# Install k6
# Linux
sudo apt-get install k6
# macOS
brew install k6
# Run basic test
npm run test:k6Apache Benchmark is a command-line tool for measuring the performance of HTTP web servers.
# Install Apache Benchmark
# Ubuntu/Debian
sudo apt-get install apache2-utils
# macOS
brew install httpd
# Run tests
npm run test:abArtillery is a modern, powerful, and easy-to-use load testing toolkit.
# Install Artillery globally
npm install -g artillery
# Or use the local installation included in package.json
npm install
# Run tests
npm run test:artilleryPrometheus is an open-source systems monitoring and alerting toolkit, and Grafana is an open-source platform for monitoring and observability.
# Start Prometheus and Grafana (requires Docker and Docker Compose)
npm run prometheus:start
# Stop Prometheus and Grafana
npm run prometheus:stopAfter starting, access:
- Prometheus dashboard: http://localhost:9000
- Grafana dashboard: http://localhost:3100 (username: admin, password: admin)
To run a complete benchmark suite across all runtimes and tools:
npm run benchmarkThis will:
- Start all servers
- Run all configured benchmark tools against each server
- Collect results in the
resultsdirectory - Stop all servers
/ping: Measures latency with minimal response/compute: CPU-intensive endpoint that simulates computationally demanding operations/memory: Allocates a larger amount of memory to test RAM usage/bulk: Used for high numbers of simultaneous requests (requests per second test)
The code in all runtimes is implemented in the simplest possible form, without additional libraries (except Express for Node.js), to focus testing exclusively on the performance of the runtime itself.
This benchmarking suite is developed as part of a Master's thesis on the topic:
"Analysis and Experimental Comparison of the Performance of Modern JavaScript Runtime Environments for Server Applications"
The research aims to provide a comprehensive and objective comparison between Node.js, Deno, and Bun, focusing on:
- HTTP server performance metrics (latency, throughput, and resource utilization)
- Real-world server application scenarios
- Quantitative analysis of performance differences
- Practical recommendations for choosing the appropriate runtime for different server-side use cases
The experimental design includes both microbenchmarks (individual API endpoints) and more complex workloads to simulate real-world server applications.
All benchmark results, analysis methodologies, and conclusions will be documented in the thesis.