Performance issue with fiber

hanabi1224 harlowmoo at gmail.com
Wed Jul 28 08:15:33 UTC 2021


On Wednesday, 28 July 2021 at 01:12:16 UTC, Denis Feklushkin 
wrote:
> Spawning fiber is expensive

Sorry but I cannot agree with the logic behind this statement, 
the whole point of using fiber is that, spwaning system thread is 
expensive, thus ppl create lightweight thread 'fiber', then if a 
'fiber' is still considered expensive, should ppl invent 'giber' 
on top of 'fiber', then 'hiber' on top of 'giber'? That will be 
infinite.

If you mean 'each fiber has its own stack' by 'expensive', to be 
fair, golang's goroutine is stackful (4KB stack for each 
goroutine), it's like >50X faster with the same test case.


More information about the Digitalmars-d-learn mailing list