Repository navigation
A 605 KB zero-Node Rust MCP server over moli --remote-debugging-pipe (9.72x less RAM & 1.94x faster than Chrome MCP) #3465
Replies: 2 comments 3 replies
|
Thanks for your |
|
Hi @wasabihu, thanks for sharing what you learned building We’d love to tell the story on our blog and share it on X, Discord, and our WeChat official account. Would it be okay to quote your benchmark results and use your charts? For the Chinese version, would you prefer that we keep the originals or redraw them with translated labels? We’d link back to this discussion and your repo. Let us know how you’d like to be credited. We’d also like to rerun the benchmark using the script you published. Could you share which Apple chip you used, how much memory the machine had, and how many runs went into each reported result? If you still have the raw output from those runs, that would help us compare ours with yours. Thanks again! |
Uh oh!
There was an error while loading. Please reload this page.
Hey Moli community!
While integrating
moli(v1.1.27) as a headless backend forsessfork(a tool that forks live Chrome Cookies + LocalStorage into headless AI agent browsers), I ran into an unexpected benchmark result — and ended up building a tiny standalone Rust MCP server (sessfork-mcp) that pairs directly withmoli serve --remote-debugging-pipe.The Profiling Surprise
When I first wired
moli servebehind Node.js@playwright/mcp@0.0.85and benchmarked 12 concurrentisolatedContexttabs loading a realistic 1,775-DOM-node SaaS dashboard (21,300 live DOM nodes total, full accessibility tree enabled on every navigation):moli+@playwright/mcpcut memory nicely (657 MBvs Chrome's2,531 MB), but took5,544 msvs Chrome's2,915 ms(1.9× slower).molidirectly over--remote-debugging-pipeshowed Moli itself wasn't slow at all: Moli parsed and rendered the 1,775-node dashboard in35.3 ms, andAccessibility.getFullAXTreetook38.9 ms.@playwright/mcpwrapper (~272 MBfixed RSS,1.2–1.8 snpxcold start) plus Playwright's injected JS aria-snapshot runtime across all 12 V8 contexts.Replacing Node
@playwright/mcpwith a 605 KB Rust CDP Pipe BridgeSo I built
sessfork-mcp(605 KB stripped binary, 13 crates, zero Node.js, zero Tokio — juststd+serde_json+libc) speaking native CDP directly over Moli's--remote-debugging-pipe(OS FD 3/4, zero TCP ports, automatic kernel EOF shutdown even onSIGKILL).Re-running the exact same 12-context heavy-DOM benchmark (still capturing the full accessibility tree on every navigation,
12/12verified,0cross-context leaks):moli 1.1.27)sessfork-mcp(Rust Pipe)initialize1,787.5 ms1,229.5 ms4.6 ms(1.7 MBidle RSS)263.8 ms672.5 ms5.9 ms3,413 ms/1,219 MB779 ms/383 MB230 ms/85 MB(14.8×faster /-93%)2,531.4 MB(15procs)656.8 MB(1proc)260.4 MB(1proc,9.72×smaller)2,915.4 ms5,543.9 ms1,501.0 ms(1.94×faster than Chrome)Dropping Playwright's JS injection even cut Moli's own RSS from
383.9 MBdown to239.2 MBand flipped Moli from0.53×slower to1.94×faster than Chrome!Standalone Usage (No Python or
sessforkNeeded)Prebuilt binaries (
darwin-arm64,darwin-x64,linux-x64,linux-arm64+SHA256SUMS.txt) are in v0.1.4 Releases:Works with Claude Code, Cursor, Antigravity, or any stdio MCP client out of the box (13 core tools +
isolatedContextsandboxes + smart SPA hydration settle + strict--output-dirconfinement). You can reproduce the entire 3-way benchmark locally in ~18 seconds viapython3 scripts/stress_test.py --heavy-compare.Huge kudos to the Moli maintainers —
--remote-debugging-pipe+Accessibility.getFullAXTree+Storage.setCookiesworked cleanly on the very first try! Feedback and edge cases are super welcome.All reactions