Skip to content

Instantly share code, notes, and snippets.

@omar391
Created May 6, 2026 16:31
Show Gist options
  • Select an option

  • Save omar391/da94c3ea15f5dc31e136cb33dca51b4a to your computer and use it in GitHub Desktop.

Select an option

Save omar391/da94c3ea15f5dc31e136cb33dca51b4a to your computer and use it in GitHub Desktop.
Node vs Bun Cold Start Benchmark
#!/bin/bash
cat << 'EOF' > server.cjs
const http = require('http');
const server = http.createServer((req, res) => res.end('ok'));
server.listen(3000, () => process.exit(0));
EOF
cat << 'EOF' > bun_server.js
const server = Bun.serve({
port: 3000,
fetch(req) { return new Response("ok"); }
});
process.exit(0);
EOF
echo "--- Node.js Cold Start ---"
time node server.cjs
echo "--- Bun Cold Start ---"
time bun bun_server.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment