惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
News and Events Feed by Topic
Malwarebytes
Malwarebytes
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cybersecurity and Infrastructure Security Agency CISA
F
Future of Privacy Forum
C
Cisco Blogs
T
The Exploit Database - CXSecurity.com
A
Arctic Wolf
S
Securelist
K
Kaspersky official blog
S
Schneier on Security
T
ThreatConnect
T
Tenable Blog
Spread Privacy
Spread Privacy
T
True Tiger Recordings
AWS News Blog
AWS News Blog
F
Fox-IT International blog
量子位
T
Threatpost
V
Vulnerabilities – Threatpost
C
CERT Recently Published Vulnerability Notes
Cisco Talos Blog
Cisco Talos Blog
GbyAI
GbyAI
宝玉的分享
宝玉的分享
腾讯CDC
G
Google Developers Blog
aimingoo的专栏
aimingoo的专栏
Cyberwarzone
Cyberwarzone
有赞技术团队
有赞技术团队
S
SegmentFault 最新的问题
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Visual Studio Blog
U
Unit 42
雷峰网
雷峰网
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
O
OpenAI News
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The GitHub Blog
The GitHub Blog
The Register - Security
The Register - Security
MyScale Blog
MyScale Blog
小众软件
小众软件
A
About on SuperTechFans
Last Week in AI
Last Week in AI
Y
Y Combinator Blog
博客园 - 三生石上(FineUI控件)
美团技术团队
Google Online Security Blog
Google Online Security Blog
P
Proofpoint News Feed
MongoDB | Blog
MongoDB | Blog

DEV Community

Running Gemma 4 26B on an Old GTX 1080 with llama.cpp Devlog 1: I tried building an SNES game with the super FX chip Why Gemma 4 Feels Like an Important Moment for AI Developers✨ From Zero and Confused, This Is How I Started Learning to Code I Built a Local AI Gateway That Talks to Claude, ChatGPT, DeepSeek and Gemini — Without a Single API Key Bootstrapping with AI: Why Gemma 4 is the Micro-SaaS Founder’s Best Friend MyErp Architecture Series - #02 Cellular Architecture: Mapping Biology to Software Systems 🌍 RTL Arabic Style UI How Does an AI Agent Actually Buy Something? Google Just Published the Spec. Google I/O 2026 Is One Uncanny F.R.I.E.N.D.S Group Upgrade I Replaced 70MB Node.js Log Viewer with a 172KB Zig Binary The "MTTR Is All You Need" Trap The Quiet Revolution: How Firebase Became the First Agent-Native Backend at Google I/O 2026 I Built ResuMate! A 100% Private, Local AI Resume Optimizer with Google Gemma 4 Learning DirectX 12 - Part 2 Initialization Theory NeuralHats: I Put Edward de Bono’s Six Thinking Hats on Local LLMs Using Gemma 4 📝 Instant Auto Save Notes Engineering the "App-Like" Experience: A Deep Dive into PWA Architecture I built a local first AI CCTV assistant using Gemma 4 + Frigate CrowdShield AI — Smart Stadium Operating System & Crowd Intelligence Platform I built a free AI observability tool, prove your AI is useful, not just running Beyond Autocomplete: Why Google Antigravity 2.0 Changes the Rules for Indie Builders 터미널 AI 에이전트 구축 (v12) Building Instagram-Powered Apps with HikerAPI (Without Fighting Scrapers) Checkpoints, Not Transcripts: Rethinking AI Coding Agent Memory From Side Project to Student Savior: My AI PPT & Resume Tool Crossed 1.5K+ Users Why Story Points Don’t Work in the AI Era, And What Should Take Their Place Instead. Self-Hosted Document AI: How to Run Document Intelligence On Your Own Infrastructure (2026) How to Extract Tables from PDFs with AI: 4 Methods That Actually Work (2026) IDP vs OCR: What's the Difference — and Which Does Your Business Actually Need? Automated PII Detection and Redaction in Business Documents: A Practical Guide Human-in-the-Loop Document Review: When to Use It and How to Set It Up (2026) Document Processing Without RPA: A Modern Approach for Small Teams Reducto Alternative: When You Need More Than a Document Parser (2026) Hermes Agent vs LangChain vs CrewAI: When to Reach for Each SparshAI: I Built an Offline AI Tutor for Students Using Gemma 4 — Here's What Happened Building NeuroSense AI: A Human-Centered Stress Insight Assistant Powered by Gemma Why I Built a Privacy-First Dev Toolkit GAS Input Tags: Ability Activation Without Hardcoded Bindings AI Legal Document Advisor Supported By Gemm 4 Model Building Convertify in Public Week 10: PDF Cluster + Blog Launch CureNet AI: Decentralized Health Intelligence for India, Powered by Gemma 4 and ABHA Standardization When Open-Weights AI Meets a Broken Healthcare System: Deploying Gemma 4 in Rural India V.A.L.I.D. Google I/O 2026: The Year Google Stopped Building AI Assistants and Started Shipping AI Engineers Bondmap: AI-Powered Relationship Network That Maps How You're Connected to Everyone Using Gemma 4 Gemma 4 challenge inspired me to build my first app! 96. LoRA: Fine-Tune a Billion-Parameter Model on a Laptop From a Student Who Used CircuitVerse to a GSoC Contributor — My Community Bonding Story How Bf-Tree Keeps Mini-Pages Small, Hot, and Cheap to Evict I asked Claude to explain the chip war and ended up understanding modern geopolitics differently Stop Manually Checking for Server Updates: Automate With Email Notifications Nostalgia Meets Cybersecurity: Spotting Modern Scams in a Retro OS Simulator - Forward or Fraud CRACKING CODING INTERVIEW From Python to Production Pipeline :A Practical guide to Apache Airflow Antigravity 2.0: Google Just Changed What It Means to Be an Engineer I Built a Free Sticker Maker Because Every Other One Hid the Export How I bypassed Blazor WebAssembly's Virtual DOM using raw WASM pointers Distributed Tracing for LLM Agents: When MCP Makes Tool Calls Observable The Zero-Budget Memory Setup Behind My AI Agent Workflow No database. No framework. Just files, startup order, correction logs, and discipline. I Built an AI Second Brain with Gemma 4 The Most Exciting Google I/O 2026 Announcement for Me: HTML-in-Canvas CrisisLens: Compressing Disaster Scenes into 200-Byte Emergency Payloads with Gemma 4 I'm 15 and I built a todo app with Telegram Stars payments — only legal way for me to monetize before turning 18 Crypto Branding After the Token Launch Building an on-chain alerts bot in Python without any blockchain library FinePrint — An AI Pocket Lawyer That Decodes Predatory Contracts Using Gemma 4 How to Connect OpenAI with Supabase in 10 Minutes for a Lightning-Fast AI MVP One AI Gateway for AWS Bedrock, Google Vertex AI, Gemini, and Anthropic Reading Log #9 — Aoashi The Tacit Dimension Thinking, Fast and Slow Web3 Onboarding Is Not a Wallet Problem. It Is a Trust Problem. FHE Prompt Privacy: The Metadata Leak Your Demo Still Has Software Might Be Becoming Agent-Aware: What if software starts coordinating itself? The Silent Killers of Go Concurrency: Mutexes, Semaphores, and Goroutine Leaks Lynx framework first look Building Aries AI: A Solo-Built AI Abacus Tutor on OpenAI + Supabase + Render + Razorpay I built a paid Telegram bot. Here's what Telegram Stars actually pay. Transfer Fees, Metadata, and Soulbound Tokens: A Tour of Solana Token Extensions Improving AI resume matching with prompt iteration — 7.37 to 8.37/10 7 things you can do with Rogue Studio that no other AI IDE will let you do Why I Think WordPress Still Matters Reading Log #7 — Aoashi Guns, Germs, and Steel Distinction Open Models and the Sub-Saharan Region What 12 Months of AI-Generated Pull Requests Taught My Engineering Team Feature Flags in .NET 8: ASP.NET Core, Minimal APIs, Blazor The Quiet Architecture of Systems That Refuse to Die From OOP to SOLID: Everything You Need to Know in One Article I Scanned 5 Common LangChain Agent Patterns. Every Single One Was Over-Permissioned. Production-Ready MCP Servers in 60 Seconds (Auth, Rate Limits, Audit Logs Included) Dari OOP ke SOLID: Semua yang Perlu Kamu Tahu dalam Satu Artikel The Most Important Part of Google I/O 2026 Wasn’t a Model — It Was the Infrastructure When SafetyCo Goes to War: Anthropic, the DOD, and the Limits of Ideals-Based Frameworks Why AI Memory Resolves Too Much — And What to Preserve Instead What Gemma 4 Means for the Future of Local AI (And Why It Matters More Than GPT-5) The Classroom Gap: Why Applied AI Has Yet to Transform How the World Learns Cell-to-Sentence (C2S): LLM-Powered scRNA-seq Annotation with Gemma 4 GitHub rust-2026-template — my Rust starter in 2026 Stop Editing JSON by Hand How I Turned an Old Movie Recommendation Project Into a Cinematic AI Platform Linux Command Line: The 25 Commands I Use Every Day (2026)
NodeJS vs Bun vs Go
Aditya Sriva · 2026-05-25 · via DEV Community

Mon 25 May 2026,

Premise:
I came across a video discussing the new Bun.image. How the developers at Bun gave it native Image support that was 'Blazing fast'.
This lead me to wonder just how much more performant bun was at regular http server as compared to NodeJS.

I am a software developer with 4 years of experience mainly at creating Node services. I feel safe to say that I have good understanding of Node's architecture, its limits and production capabilities when handling high throughput network I/O

However, I am still very new to Bun, So, I decided to make this simple benchmark, where I run a simple http server in Node, Bun and GO.

GO is just a control here. Given the bare-metal nature of Go, I thought it would be a good control, and help me understand how much bloat do Node and bun carry, within their V8/JSC and libuv/zig.

The Cloud-Native Battle Royale: Node vs. Bun vs. Go

From Localhost to Cloud Reality—Tracking the Bottlenecks Step-by-Step.

Its easy to confuse localhost performance to that of hosted environments. You run a quick hello-world benchmark on localhost, watch Bun or Node spit out massive numbers inside your laptop's RAM, and declare your favorite runtime the undisputed king of speed.

But localhost is a lie. Inside RAM, you aren't testing software architecture—you're testing how fast your CPU can copy strings across a local memory bus.

To uncover the some of the production truth, I will be comparing three popular backend stacks, sandboxed them strictly inside Docker, and ran them through controlled configs:

from local memory buses,
over an encrypted Wi-Fi mesh network,
and finally unchained onto enterprise-grade Linux cloud hardware.


Node, Bun and Go all will be running default out of the box http servers. They will handle incoming traffic on /json and return a simple json response.
{ message: 'Hello from ${Node/ Bun/ Go}' }

Phase 1: The Localhost Baseline

Our journey started on a local Windows development machine. We pinned our containers to a single core, scaled up to 4 cores using standard single-threaded configurations, and finally introduced clustering.

Phase 1 Ledger: Local Memory Performance

Benchmark Phase Node.js Bun Go (Optimized Raw Bytes)
1 CPU Core Baseline ~14,000 RPS ~28,000 RPS ~29,000 RPS
4 CPU Cores (No Cluster) ~16,000 RPS (Stuck) ~30,000 RPS (Stuck) ~115,000 RPS 🚀
4 CPU Cores (Clustered) ~110,000 RPS ~170,000 RPS 🏆 N/A (Go handles natively)

The Localhost Plot Twist

  • The Single-Threaded Wall: In the 4-core run with no clustering, Node and Bun completely stalled. Because JavaScript is single-threaded, they could only ever utilize 100% of a single core, leaving the other 3 cores sitting completely idle. Meanwhile, Go's native scheduler effortlessly utilized the available hardware, scaling to 115,000 RPS out of the box.
  • The Clustered Beast: The moment we turned on Node's cluster module and spawned 4 parallel instances of Bun, the JavaScript engines woke up. Bun rocketed to a staggering 170,000 RPS over local memory. On paper, it looked completely untouchable.

Phase 2: The Physical Reality Check (Over Tailscale)

Then came the first massive architectural shift. We forced the packets to leave the cozy confines of local laptop RAM and cross a real, physical network layer. I hooked up my MacBook over Tailscale virtual private mesh network, sending requests over the airwaves via a local Wi-Fi adapter.

The moment traffic hit the air, the 170,000 RPS powerhouses slammed headfirst into a concrete wall.

Phase 2 Ledger: The Encrypted Airwaves (4 Cores)

Metric Node.js (4 Workers) Bun (4 Instances) Go (Optimized Raw Bytes)
Throughput (RPS) 7,954 RPS 12,519 RPS 12,873 RPS 🏆
Average Latency 26.79 ms 16.49 ms 15.69 ms 🏆
Max Outlier Latency 864.53 ms ⚠️ 163.24 ms 152.21 ms 🏆
Data Transfer Rate 1.62 MB/s 1.76 MB/s 1.67 MB/s

Shifting from CPU to Network-Bound I/O

The engines were no longer fighting each other; they were all waiting in line for the physical Wi-Fi card to modulate radio waves and process encrypted WireGuard UDP wrappers.

  • Go Reclaimed the Crown: Because Go's native network poller integrates directly with the OS kernel stack, it handled network jitter with absolute stability, locking down the lowest average and outlier latencies.
  • Node.js Crumbled Under Jitter: Node's master process struggled to distribute incoming packets with uneven arrival times to its workers, causing outlier latencies to skyrocket to a near-fatal 864ms.

Important to note that my PC has a very basic tenda u10 wifi usb adapter. It only supports wifi3 and was very likely the bottleneck.

This highlighted that often, systems are network bottlenecked, and its unfair to continue testing with my current hardware and environment. So I decided to isolate the tests from my hardware limitations by hosting them on digital ocean droplets.


Phase 3: Unchained on the Cloud

To find out the absolute ceiling of our code without network noise or local virtualization layers, I moved the experiment onto enterprise-grade Linux cloud hardware (DigitalOcean Shared Droplets over a 10 Gbps data center backplane).

Deployed a target server VM and a separate attacker VM inside the same data center switch, isolated their resource environments natively via Docker runtime flags, and re-ran the gauntlet.

Step 3.1: Running the Baseline Cloud Sandboxes (1 CPU)

To run the isolated 1-Core tests on the target host, we spun up each server container using a strict resource quota constraint:

# Target VM - Launching Single Core Baselines
docker run --rm --cpus="1" -m="512m" -p 3000:3000 --name cloud-bench node-bench
docker run --rm --cpus="1" -m="512m" -p 3000:3000 --name cloud-bench bun-bench
docker run --rm --cpus="1" -m="512m" -p 3000:3000 --name cloud-bench go-bench

Enter fullscreen mode Exit fullscreen mode

Phase 3 Ledger: Cloud-Native 1-CPU Baseline

Metric Node.js (1 Core) Go (1 Core - Optimized) Bun (1 Core)
Throughput (RPS) 11,705 RPS 13,935 RPS 25,444 RPS 🏆
Average Latency 29.13 ms 22.83 ms 7.89 ms 🏆
Max Outlier Latency 2,000.00 ms ⚠️ 135.97 ms 93.27 ms
Failed Requests 60 Timeouts ⚠️ 0 0

On a single cloud core, Node’s V8 engine choked trying to handle 11k packets per second alongside its own internal event loop bookkeeping, dropping 60 socket timeouts. Bun's ultra-lightweight Zig event loop effortlessly handled the single-core constraint, smashing Go by double the speed.


Phase 4: Full Multi-Core Cloud Concurrency

Finally, we opened the valves completely. I scaled the target configurations to a 4 CPU Core allocation using clustered variants for the JavaScript runtimes to allow multi-threaded scheduling:

# Target VM - Launching Multi-Core Clusters
docker run --rm --cpus="4" -m="512m" -p 3000:3000 --name cloud-bench node-bench-c
docker run --rm --cpus="4" -m="512m" -p 3000:3000 --name cloud-bench bun-bench-c
docker run --rm --cpus="4" -m="512m" -p 3000:3000 --name cloud-bench go-bench

Enter fullscreen mode Exit fullscreen mode

The Automation Attack Script

To collect clean, zero-friction metrics, the Attacker VM offloaded the load generator inside an Alpine container using an optimized execution thread limit:

# Attacker VM - The Native wrk Attack Command
docker run --rm alpine sh -c "apk add --no-cache wrk && wrk -t2 -c200 -d30s http://159.65.6.89:3000/json"

Enter fullscreen mode Exit fullscreen mode

Phase 4 Ledger: Cloud-Native 4-CPU Maximum Performance

Metric Node.js Cluster (4 Cores) Go Optimized (4 Cores) Bun Cluster (4 Cores)
Throughput (RPS) 31,025 RPS 37,617 RPS 53,446 RPS 🏆
Total Requests (30s) 933,074 1,130,171 1,605,818
Average Latency 8.62 ms 5.79 ms 4.04 ms 🏆
Worst-Case Spike 641.25 ms ⚠️ 218.91 ms 76.54 ms 🏆
Peak CPU (Docker Stats) >400% (Thrashing) 340% (Highly Efficient) 🏆 383% (Perfect Scaling)

The Architectural Post-Mortem

1. Bun is the New Raw I/O King (53,446 RPS)

Bun scaled almost perfectly linearly across the 4 vCPUs, hitting 383% CPU utilization in docker stats. By dropping V8's weight and building its HTTP server straight into Zig, Bun handles native OS socket interactions with almost zero orchestration loss. It spent practically zero time handling internal lock contention, keeping its average latency at a jaw-dropping 4.04ms under massive load.

2. Go is an Infrastructure Masterpiece (37,617 RPS)

Go generated elite throughput while using only 340% CPU, leaving an entire 60% of a physical core free for the OS to breathe.

We achieved this by bypassing the standard routing tree and writing pre-rendered raw bytes directly to the network buffer—completely eliminating runtime reflection and heap allocations. Go's native user-space goroutine scheduler managed the multi-core scaling in a single process, proving why it remains the gold standard for resource efficiency and predictability.

3. Node.js Suffers From the "Cluster Tax" (31,025 RPS)

Node bounced back, but it ran hot—constantly thrashing above 400% CPU utilization. Because Node requires separate cloned V8 processes communicating via Inter-Process Communication (IPC) to pass socket descriptors, the CPU burns valuable clock cycles handling internal kernel-space locking and thread synchronization instead of serving requests.


The Production Takeaway

  • Bun is no longer just a fast local test runner; its cloud-native I/O layer is a legitimate production speed-demon.
  • Go remains the rock-solid king of predictable infrastructure, giving you massive throughput with flatlined resource consumption and unparalleled stability.
  • Node.js works, but under extreme enterprise concurrency, its legacy multi-process architecture forces your hardware to work significantly harder to produce less output.

Code snippets

Bun - Clustered

Bun.serve({
  port: 3000,
  reusePort: true, // Key flag: allows multiple processes to bind to port 3000
  fetch(request) {
    const url = new URL(request.url);
    if (request.method === 'GET' && url.pathname === '/json') {
      return new Response(JSON.stringify({ message: "Hello from Clustered Bun!" }), {
        headers: { 'Content-Type': 'application/json' },
      });
    }
    return new Response("Not Found", { status: 404 });
  },
});

Enter fullscreen mode Exit fullscreen mode

Node - Clustered

const cluster = require('cluster');
const http = require('http');
const numCPUs = 4; // Matching our --cpus="4" flag

if (cluster.isMaster) {
  // Fork workers for each core
  for (let i = 0; i < numCPUs; i++) {
    cluster.fork();
  }

  cluster.on('exit', (worker) => {
    cluster.fork(); // Simple failover
  });
} else {
  // Workers share the TCP connection
  http.createServer((req, res) => {
    if (req.method === 'GET' && req.url === '/json') {
      res.writeHead(200, { 'Content-Type': 'application/json' });
      res.end(JSON.stringify({ message: "Hello from Clustered Node!" }));
    } else {
      res.writeHead(404);
      res.end();
    }
  }).listen(3000);
}

Enter fullscreen mode Exit fullscreen mode

Go

package main

import (
    "fmt"
    "net/http"
)

// Pre-render the exact JSON byte slice at startup to completely eliminate allocation/reflection
var jsonResponse = []byte(`{"message":"Hello from Go!"}`)

func jsonHandler(w http.ResponseWriter, r *http.Request) {
    if r.Method != http.MethodGet {
        w.WriteHeader(http.StatusMethodNotAllowed)
        return
    }

    // Set headers and write raw bytes directly to the network buffer
    w.Header().Set("Content-Type", "application/json")
    w.Write(jsonResponse)
}

func main() {
    // Disable internal tracking features we don't need for a barebones benchmark
    server := &http.Server{
        Addr:    ":3000",
        Handler: http.HandlerFunc(jsonHandler),
    }

    fmt.Println("Optimized Go running on port 3000")
    server.ListenAndServe()
}

Enter fullscreen mode Exit fullscreen mode