digital-fabric / polyphony

Fine-grained concurrency for Ruby
https://www.rubydoc.info/gems/polyphony
MIT License
658 stars 17 forks source link

Debugging fiber selection times #122

Open renatolond opened 1 year ago

renatolond commented 1 year ago

While exploring polyphony, we did a simple comparison between a multi-threaded software we use and polyphony and we ended up seeing that while polyphony is faster in avg, the max times are much higher than in our threaded version.

However, we couldn't find a way to measure this from inside the executed program. If we add monotonic measures on the server, we seem to get much lower times than we get on the client side. (around 3s on the client side vs 0.9 on the server side at most).

I don't know how to debug what's taking the time, though I would suspect that it's because the main fiber (the one accepting the connection) is suspended, do you have any advice on how to debug this?