View Code? Open in Web Editor
NEW
A repository to perform various bun vs nodejs benchmarking
Dockerfile 4.35%
JavaScript 95.65%
bun-benchmark's Introduction
- Prometheus: localhost:9090
- Prometheus log exporter(express): localhost:9092
- Grafana: localhost:3000
- Postgres: localhost:5432
- Websocket: localhost:4080
- Express/Elysia: localhost:4000
How to test http and websocket load test
- Update Dockerfile with the chosen runtime and command. Create
.env
file and copy values from .env.example
.
- docker-compose build && docker-compose up
- open localhost grafana on browser (localhost:3000) with username: admin, password: admin1
- prepare graphs for metrics
nodejs_memory_usage_in_bytes
and nodejs_cpu_usage_in_percentage
- install k6 and run load test
- k6 run src/http-request-load-test.js or
- k6 run src/websocket-load-test.js
- View metrics on grafana
- docker-compose down
How to test file read/write
- Install Hyperfine
- run
- hyperfine 'node src/read-write-node.js' 'bun run src/read-write-node.js'
- hyperfine 'bun run src/read-write-node.js' 'bun run src/read-write-bun.js'
- hyperfine 'node src/read-write-node.js' 'bun run src/read-write-bun.js'
bun-benchmark's People
Contributors
Stargazers
Watchers