luowy wrote:I think we need some examples to measure our coroutine's efficiency
compare with other language or paltform, like node.js, dotnet
e.g thousands clients connect to server(net or files)
Is that possible at moment?
With the current implementation what you get is the efficiency of Windows fibers
plus some procedure call and state maintenance overhead. But it is dominated
by the fiber operations. The fibers are supposed to be pretty fast. It is the fastest
you can get at the WinApi level. Fibers are handled completely in user space, i.e.
there is no context switching to the Windows kernel.
The number of coroutines that you can have at the same time is limited by the
available memory and affected by the stack size chosen.
On my machine I get about 200 coroutines with the default stack and
about 6000 coroutines with a small stack.
The limits are subtle. The
min stack size sum is limited by the available swap space,
the
max stack size sum is limited by the available virtual address space.
Note that fibers use dynamically growing stacks between
min and
max.
I don't have the time to do all the comparisons but feel free to do it.
Some comparisons have been published on the community forum,
see
https://community.blackboxframework.org ... rt=20#p968.
It shows that BlackBox coroutines are almost as fast as XDS, which is, as I understand the posting,
using handcrafted assembly code.
- Josef