The Future of D Runtime

Dmitry Olshansky dmitry.olsh at gmail.com
Thu Jun 13 18:50:45 UTC 2024


On Tuesday, 11 June 2024 at 09:25:15 UTC, Adam Wilson wrote:
>> [...]
>
> That strikes me as more of an opinion than objective fact. I 
> led a detailed discussion of this topic on Discord. The end 
> result was that the stack size issue ends up being catastrophic 
> in non-trivial workloads. Vibe went with a 16MB stack size for 
> precisely this reason, which means that to handle 65536 
> simultaneous connections, I need a server with *1TB* of RAM. 
> The reason for that is that due to performance concerns, we 
> turn off over-commit and thus allocating 16MB per stack means 
> that you are fully committing 16MB of physical RAM. 
> Go/Java/.NET, can all handle 10x that number of connections on 
> a server with 128GB of RAM, so that's the bar we have to meet.
>
> No other language suffers this problem, not even Go. The reason 
> is that all languages that successfully use Fibers, use 
> dynamically expanding stacks, but this means using a precise 
> stack-scanning moving GC. Something that D, so long as Walter 
> is among the living, will never have.
>
> Stackless coroutines also do not suffer this problem, which is 
> why .NET and Rust use them.

I’ve measured the overheads of having millions of fibers with 
16mb of stack even with overcommit it’s way too much. We have to 
go stackless much as I do not like it.

—
Dmitry Olshansky
CEO @ [Glow labs](https://glow-labs.pro)
https://olshansky.me




More information about the Digitalmars-d mailing list