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

Extract core state machine to lua module #362

Merged

Conversation

charliefoxtwo
Copy link
Member

@charliefoxtwo charliefoxtwo commented Oct 7, 2023

Extracted a lot of the bios loop into BIOSStateMachine.lua as part of my warpath to remove all dofile calls.

This removes a lot of static calls from Protocol and refactors ProtocolIO to be an instance-based connection manager. The remainder of Protocol likely have to wait until all modules are migrated.

I'm still testing to validate performance is equivalent and that everything works as expected (initial testing would indicate so, but I'd like to continue testing to be on the safe side).

EDIT: In my testing, performance was effectively identical. For my tests, I incremented a counter every time we skipped sending data because we hadn't yet reached the next frame time (1/30 seconds). This happens if we're too quick, so it's generally a good thing. In my testing (on my machine), I found that both my version and the original skipped sending data 3 times between each actual send around 95% of the time. Given the behavior between each version was identical, I'm comfortable moving forward.

@charliefoxtwo charliefoxtwo marked this pull request as ready for review October 7, 2023 23:09
jdahlblom
jdahlblom previously approved these changes Oct 9, 2023
Copy link
Contributor

@jdahlblom jdahlblom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5/5 stars, understandable and clean.

@jdahlblom jdahlblom added this pull request to the merge queue Oct 9, 2023
Merged via the queue into DCS-Skunkworks:master with commit 989589d Oct 9, 2023
2 checks passed
@charliefoxtwo charliefoxtwo deleted the feature/core-loop-refactor branch October 9, 2023 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants