Hundemeier / sacn

A simple ANSI E1.31 (aka sACN) module for python.
MIT License
47 stars 21 forks source link

Remove Debug Logs #25

Closed shauneccles closed 3 years ago

shauneccles commented 3 years ago

The LedFx project has been hunting for performance gains on lower powered devices and has encountered significant differences in performance between raw UDP and sACN devices - some were expected given the more complex (and better) functions of sACN, however it was unexpectedly degraded. This was particularly pronounced when spinning up multiple sACN threads.

We've isolated it to some residual debug loggers - in particular a debug log for every packet sent.

This PR removes the remaining debug log calls.

We profile an approx. 20-30% increase in performance for the entire thread stack.

Thanks for your ongoing work on a library we rely on.

Shaun & the LedFx Team Additional Information: Library as current debug_logs_enabled

Library with Debug Logs Removed debug_logs_disabled

Hundemeier commented 3 years ago

Thanks for this pull request!

As you can imagine, the performance of this library never was any concern during the development. It is nice, that someone actually profiled it, so thank you for that!

I think these changes are acceptable given the performance penalties for leaving the debugging statements active. When debugging the library, one can re-add these statements. And nice catch of the empty logging statement!

Due to the change in functionality, it is released as v1.5.