New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce gnss_syncro_monitor CPU load #662
base: next
Are you sure you want to change the base?
Conversation
7ed3241
to
232154f
Compare
232154f
to
0256638
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can believe that this improves performance (your evidence is compelling) but I'm not sure this is a quality fix. It may be; the case just hasn't been made.
0256638
to
52d9e21
Compare
52d9e21
to
727bf0c
Compare
8298fcd
to
afdc1bf
Compare
I still don't like the brittleness of this approach, but I am not sure there is a better one. I see you had to increment the channels to the ctor of the Acq monitor; the same change is needed (most likely) for the Tracking monitor. Arguably, this could be moved to the ctor, so callers don't have to remember/know about this "extra" port (this is part of the brittleness; Or, you could just fix the tracking monitor as well. |
afdc1bf
to
14c9d88
Compare
Thanks. I see at least 2 different solutions to this problem:
|
This would be such a fundamental change to architecture, it's unlikely to be accepted.
The default scheduler behavior should be to sleep for 250ms; however, I suspect that I don't have a problem with the time strobe being an input, but the N+1 th is a maintenance burden. I don't know if there is a way to make a different "class" of input, to make it clear that it's different, or worst case, move it to the 0th input. It still creates a brittle reliance on external users to configure it correctly, and it's too easy to get wrong. |
For some unknown reason gnss_synchro_monitor stays in a tight loop trying to catch all syncros and sometimes consumes the whole CPU core. Triggering the gnss_syncro_monitor from sample counter as it is done with observables greatly reduces CPU usage from ~60...90% to <1%. Signed-off-by: Vladislav P <vladisslav2011@gmail.com>
14c9d88
to
1a6efca
Compare
@carlesfernandez can this be merged? |
I an using tkhis patch. It reduces CPU load significantly. Without the patch I had load burst to 100% when monitoring is enabled, afer the patch is applied the CPU load is stable 25-30% while receiving GPS L1 signal with rtl-sdr dongle. |
For some unknown reason gnss_synchro_monitor stays in a tight loop trying
to catch all syncros and sometimes consumes the whole CPU core.
Triggering the gnss_syncro_monitor from sample counter as it is done
with observables greatly reduces CPU usage from ~60...90% to 1..2%.
CPU usage.
Before:
After:
Fixes #661