Conversation
As all event callbacks and queue automatically create a new fiber upon suspension, there's no need for a separate function anymore. EventLoop::queue can be used as direct replacement without the need to even create a new fiber if there's no suspension happening.
WyriHaximus
left a comment
There was a problem hiding this comment.
Love the clean up, but somehow missed that we run each futureTick/timer callable in a fiber. Not sure what the performance implications of that are but will get back to that later.
For 100,000 watcher invocations the overhead was about half a second on my machine, going from about 2.5 seconds to 3 seconds. I think the usability win is well worth the performance penalty. Obviously any real-world application will be limited by what the callbacks are doing more than the fiber-swtich overhead. |
Hence why I want to try it out before raising it as an issue 😄 . |
As all event callbacks and queue automatically create a new fiber upon suspension, there's no need for a separate function anymore. EventLoop::queue can be used as direct replacement without the need to even create a new fiber if there's no suspension happening.
This is building on top of #3.