GraalJS as an alternate to bun #12655
Unanswered
ivan-velikanov
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
For a long time I've wondered: could GraalVM compete with Bun? This feels more relevant now that Bun was acquired by Anthropic.
Using Claude Code on Bun, I noticed it's memory-heavy but produces nice single executables. Bun's
bun buildfeels cleaner than GraalVM's native-image (no MSVC dependency on Windows).I've also wondered: could there be a polyglot GraalVM tool like Bun - not just for Node.js but Python and Java too? A "GUN" (GraalVM Universal Node... just kidding 😄). With all that polyglot/AOT power, where does GraalVM head if not providing better alternatives?
Disclaimer: These benchmarks were generated with AI assistance (Claude). While I monitored and corrected issues along the way, I'm not an expert - please take results with appropriate skepticism!
Quick Observations
If GraalVM instances could share memory via CDS/AOT caching, this overhead might be justified. But currently it's significant.
Benchmark Results Summary
Runtimes Tested (All with JIT warmup)
Key Test Results (After Warmup)
⭐ TeaVM WASM surprisingly beats everyone on object creation!
GraalVM vs Bun Detailed Comparison
Cold Start
After JIT Warmup (10+ iterations)
Consistency
Memory & Startup
My Humble Suggestions
GraalVM should benchmark against Bun, not just Node.js - Bun is the new performance bar
Consider TeaVM collaboration - TeaVM WASM performed surprisingly well (4.4x slower than Java, similar to GraalVM). Perhaps symbiotic development could benefit both projects? Just as Anthropic acquired Bun...
Java ecosystem is mature - Incremental JDK improvements are welcome but the exciting frontier is JavaScript/WASM. GraalVM's future outside JVM seems to be competing in that space
Caveats
Test Environment
TL;DR: Native Java JVM wins overall. Bun is 2.45x faster than GraalVM after warmup. TeaVM WASM is surprisingly competitive. Perhaps GraalVM could learn from or collaborate with these projects?
Benchmarks code and testing done with AI assistance - corrections and scepticism welcome!
Beta Was this translation helpful? Give feedback.
All reactions