You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm submitting a ...
[ ] bug report
[x] feature request
[ ] question about the decisions made in the repository
[ ] question about how to use this project
Summary
I'm running this lib in a simple script on a relatively low performance Raspberry PI and after a week of runtime I noticed that the node processes using atem-connection has high (8% average) overall CPU usage. Here is my proposal.
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)
I dug down deep and found that this timer called _retransmitTimer fires every 10 milliseconds a function called _checkForRetransmit to check if there is any packets to resend (or reconnect if stuck, etc).
Since all its logic depends on the members of the _inFlight array, I would kindly ask to enable the timer only when there are actual packets referenced in this array, and close() it once all packets are sent. This would also affect the startTimers function which creates this timer right after connecting. This way we can spare CPU time.
If busy I'm happy to create a PR later but first I'll have to get familiar with TS.
The text was updated successfully, but these errors were encountered:
What model of pi are you using here? On a pi4 I am seeing around 2% usage of a single core, so not a very significant load.
My only concern with this is that it will mean we have to be very careful to ensure the timer gets started and stopped at the right times. That said I'm not opposed to this, but it'll need to be well tested before being merged into a release version
I'm submitting a ...
[ ] bug report
[x] feature request
[ ] question about the decisions made in the repository
[ ] question about how to use this project
Summary
I'm running this lib in a simple script on a relatively low performance Raspberry PI and after a week of runtime I noticed that the node processes using
atem-connection
has high (8% average) overall CPU usage. Here is my proposal.I dug down deep and found that this timer called
_retransmitTimer
fires every 10 milliseconds a function called_checkForRetransmit
to check if there is any packets to resend (or reconnect if stuck, etc).Since all its logic depends on the members of the
_inFlight
array, I would kindly ask to enable the timer only when there are actual packets referenced in this array, and close() it once all packets are sent. This would also affect thestartTimers
function which creates this timer right after connecting. This way we can spare CPU time.If busy I'm happy to create a PR later but first I'll have to get familiar with TS.
The text was updated successfully, but these errors were encountered: