Hacker News new | ask | show | jobs
by ankit70 568 days ago
NodeJS is better at memory than go?
2 comments

They are doing different things in this benchmark.

NodeJS has one thread with a very tight loop.

Go actually spawned 1M green threads.

Honestly this benchmark is just noise. Not to say useless in most real world scenarios. Specially because each operation is doing nothing. It would be somewhat useful if they were doing some operation like a DB or HTTP call.

I'd expect that because Promises are small Javascript objects while goroutines each get a stack that grows from at least 2 KB.
Otoh Go actually supports concurrency.
Well they are all concurrent. I think what you mean is Go is also parallel. As is C#, Rust and Java in this bench.