Jakeler / ble-serial

"RFCOMM for BLE" a UART over Bluetooth low energy (4+) bridge for Linux, Mac and Windows
https://blog.ja-ke.tech/tags/#bluetooth
MIT License
264 stars 37 forks source link

Perfomance: Blocking Linux IO in ThreadPool #19

Closed Jakeler closed 3 years ago

Jakeler commented 3 years ago

Performance is already a lot better than with bluepy, but in theory the asyncio event loop should be not blocked with IO. Fix with ThreadPool executor in linux_pty + fs_log similar to: https://github.com/changyuheng/aioserial/blob/master/packages/aioserial/aioserial.py Also remove aioserial dependency.

Jakeler commented 3 years ago

I implemented it in: ecb3e66 (branch: linux-non-blocking) But it does not bring any improvements with these tests e505395, results in ac3529913b826abfbe9c23060cddccc5c401766e Also this causes problems with the shutdown routine, it needs as it is 2 interrupts (SIGINT | Ctrl+C) to fully stop both executors... So I am not merging it now, but might retest and reconsider it in the future.