8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
比如一个 schedule 里面有 100个 stack,每个 2MB,一共 200MB,每个栈,管理一组 coroutine 假设有 5000个 coroutine ,平均分布在 100组栈上,每组栈 50个 coroutine。
coroutine 被切走的时候,并不会马上拷贝栈,而会保留在那一个栈上,直到同一组的 coroutine 需要resume,才会把之前 on-stack 的 coroutine 拷贝走。
这样每个 stack 上保留的 coroutine 都是最近最活跃的 coroutine,栈拷贝的次数下降100倍。