Hacker News new | ask | show | jobs
by jasfi 1069 days ago
Does anyone know why Bun (without --smol) sometimes uses much more memory than Node? Is this due to not being v1 yet?

I'm also wondering if some old benchmarks could now be irrelevant.

5 comments

The heap size grows faster & stays larger in the default configuration, adjusted for the amount of memory the computer has

We might enable —smol by default though.

The garbage collector configuration in JavaScriptCore is still kind of a mystery to me. I think we would ideally have something in-between —smol and default. I expect we will fiddle with this more shortly before or after 1.0

OK thanks. Is that noted on the Bun site? Sounds like an FAQ.
Using more memory to increase performance is a good thing. All software should be doing it, especially one that is meant to run server-side. Who cares if Bun takes a couple hundred MBs extra (which is worth like $0.20)? It is also like 5-20x faster than Node for basic tasks because of it.
> Who cares if Bun takes a couple hundred MBs extra (which is worth like $0.20)?

Users of a software whose author decided to use tool that only cares about server side.

I wanted to make sure that was the case, instead of inefficiency.
I don't know how different it is, but my guess is mostly that Node.js uses v8 and bun uses JavascriptCore.
Use v8 (node/deno) if JSC (bun) doesn't suit you

https://medium.com/walmartglobaltech/react-native-memory-pro...

Am I misinterpreting or does it sound a bit arrogant as a response?
Yes, you are misinterpreting it.