Skip to content
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

Read lua buffer until empty #429

Merged

Conversation

klutvott123
Copy link
Member

@klutvott123 klutvott123 commented Jan 22, 2022

Reads everything from the lua input buffer in one lua cycle.

The current behaviour is to read one frame from the buffer each lua cycle which is approximately every 50ms.

With this change the script will read frames from the buffer until it's empty. This can speed up the page loading significantly depending on the protocol used. For smartport/fport/crossfire it will likely not have a big effect. For smartport we get a lot of small frames at a slow interval and for crossfire the frames are large so the whole payload fits in one or two frames.
For ghost(#419) on the other hand we get small frames at a fast rate so it's possible that the buffer fills up quickly and there are actually multiple frames in the buffer so it makes sense to read them all instead of one small frame every 50ms.

@klutvott123 klutvott123 added this to the 1.7 milestone Jan 22, 2022
@klutvott123 klutvott123 self-assigned this Jan 22, 2022
@klutvott123 klutvott123 marked this pull request as draft June 17, 2022 23:42
@klutvott123 klutvott123 force-pushed the read-lua-buffer-until-empty branch from cea9054 to 626cd12 Compare September 14, 2022 16:52
@klutvott123 klutvott123 force-pushed the read-lua-buffer-until-empty branch from 626cd12 to 8809aa3 Compare September 14, 2022 17:01
@klutvott123 klutvott123 marked this pull request as ready for review September 14, 2022 17:02
@klutvott123
Copy link
Member Author

This is ready to go. It's important for ghost performance

@haslinghuis haslinghuis merged commit 7807026 into betaflight:master Sep 15, 2022
@klutvott123 klutvott123 deleted the read-lua-buffer-until-empty branch February 16, 2023 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants