Lightpanda Builds a Headless Browser in Zig: 123MB for 100 Pages, and It's Not a Fork of Chrome
Memory and start-up costs directly affect how many concurrent agents a deployment can support and what it bills per task. A browser that drops 16x the memory footprint without changing automation scripts changes the economics of running large-scale scraping and AI agent fleets, and also reveals that the commodity headless Chrome assumption is not the only path.
Lightpanda tackles the memory and latency overhead of running headless Chrome for AI agents. Instead of forking Chromium, the project writes a minimal browser in Zig that embeds V8 for JavaScript, uses Libcurl for HTTP, and html5ever for HTML parsing, leaving out the entire rendering pipeline, compositor, and GPU processes that exist only for human viewing. Its official benchmark claims 123MB peak memory for 100 real pages against 2GB for headless Chrome, and 5-second execution versus 46 seconds, on an entry-level m5.large instance.
The browser implements Chrome DevTools Protocol natively, so Puppeteer and Playwright scripts work by only changing the connection address. An agent mode produces PandaScript, a deterministic JavaScript script that replays offline with zero token cost, separating LLM-driven exploration from production execution. An MCP server supports per-session isolation via the Mcp-Session-Id header, allowing multiple agents to share one endpoint without clobbering each other's state. The tradeoffs are AGPL-3.0 licensing, no native Windows builds, and an incomplete Web Platform Tests pass rate that may break sites relying on complex rendering or WebGL.
The 123MB versus 2GB difference is structural, not a tune-up: a browser that never constructs a render tree will always outrun one built to paint pixels, which means any agent platform that still pays per Chrome instance is overpaying.
Choosing V8 and html5ever instead of writing own components gives Lightpanda compatibility credibility while keeping the codebase small enough for a small team to maintain; the same reasoning applies to anyone weighing a fork versus a greenfield build.
The PandaScript separation of exploration and execution is a sensible pattern for production AI automation: let the LLM nail down the flow, then freeze it into deterministic code that can be reviewed and version-controlled.
Session isolation via an HTTP header is a concrete improvement over the single-global-page MCP servers common elsewhere, turning a multi-agent scraping deployment from a race condition into a manageable design.
The daily public posting of Web Platform Tests results is a better trust signal than any self-reported benchmark because it exposes both the strengths and the compatibility gaps without marketing spin.
How do you use it with Java?
If you're using Playwright for Java, first run `lightpanda serve --host 127.0.0.1 --port 9222`, then replace your original `launch()` with `playwright.chromium().connectOverCDP("ws://127.0.0.1:9222")`. Start with a simple page to test opening and locating elements. Are you currently using Playwright or Selenium?