News for hackers. Stuff that matters.
Re:How much memory do you need in 2024 to run 1M concurrent ... by amazingamazing on Thursday November 28, 2024 @11:11PM (#42270729)
Yet again nodejs surpasses my pre-read expectations 3rd best (generalized) for a million? Wow.

I must be missing something - isn’t Go supposed to be memory efficient? Perhaps promises and goroutines aren’t comparable?

Re:How much memory do you need in 2024 to run 1M concurrent ... by fuzzybear3965 on Thursday November 28, 2024 @11:37PM (#42270842)
I'm not sure what "memory efficient" means. But, Go sprung as a competitor to Java (portability, language stability, corporate language support/development) and C++ (faster compile times). Can't beat C++ in terms of memory management (performance, guys, not safety) much. But, you can fare well against the JVM, I'm guessing.
Re:How much memory do you need in 2024 to run 1M concurrent ... by jpgvm on Thursday November 28, 2024 @11:54PM (#42270929)
In this benchmark actually no, Go doesn't fare well. There is actually higher static overhead per goroutine than JVM VirtualThread. I presume this is because of a larger initial stack size though/

This probably doesn't matter in the real world as you will actually use the tasks to do some real work which should really dwarf the static overhead is almost all cases.

Re:How much memory do you need in 2024 to run 1M concurrent ... by brabel on Friday November 29, 2024 @02:10AM (#42271617)
If you want to run 1 million coroutines that just sleep in your app, yeah nodejs looks very efficient. The problem is that when each coroutine needs to allocate memory, which I would suppose anything real would do, the 2Kb Go pre-allocates will be an advantage - as it will probably be required except for the most trivial workloads (like in this benchmark) - and then because Go actually runs them in parallel, unlike nodejs, you would likely see a huge improvement in both performance and memory usage with Go or Rust.