HNHacker News
TopNewBestAskShowJobs

JB_Dev

120 karma · joined July 17, 2022

submissionscomments
JB_Dev··on How much memory do you need to run 1M concurrent tasks?
The other thing I noticed is that they are wrapping every Task.Delay(…) inside a Task.Run(…) call. That should not be necessary. The inner task will yield back to the called when it hits the delay call anyway. There is no need to queue it with an immediate yield as if it is background or cpu-bound work.

The Run() call might be creating a more complex state machine and using more memory than necessary (2 tasks vs just 1 for each delay). The memory usage might be even lower if the Run() call is dropped.

← PreviousPage 2 of 2