atomashpolskiy / bt

BitTorrent library and client with DHT, magnet links, encryption and more
https://atomashpolskiy.github.io/bt/
Apache License 2.0
2.42k stars 381 forks source link

Merge MessageDispatcher into NIO loop #130

Open atomashpolskiy opened 4 years ago

atomashpolskiy commented 4 years ago

This is one of the remaining performance bottlenecks. Instead of busy-polling message consumers and producers in MessageDispatcher, we should do it in the NIO loop (aka DataReceivingLoop) based on the readiness flags of selected keys. I.e.:

Expected benefits: