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

Optimize implementation to try to eliminate warnings about blocking #2

Merged
merged 17 commits into from
Nov 7, 2023

Conversation

mill1000
Copy link
Owner

@mill1000 mill1000 commented Nov 7, 2023

  • Parse single sentences at a time
  • Publish states separately from sentence reception
  • Only publish changed states
  • Use enums for keys to reduce the number of string comparisons
  • Remove zero-initialization of buffers
  • Tokenize the sentence in place
  • Reduce buffer sizes
  • Preallocate strings when possible and perform in-place edits

Current warnings are

[21:42:22][W][component:214]: Component winix_c545 took a long time for an operation (0.15 s).
[21:42:22][W][component:215]: Components should block for at most 20-30ms.

with these changes it's reduced by about half

[22:03:05][W][component:214]: Component winix_c545 took a long time for an operation (0.08 s).
[22:03:05][W][component:215]: Components should block for at most 20-30ms.

Close #1

@mill1000 mill1000 added the enhancement New feature or request label Nov 7, 2023
@mill1000 mill1000 self-assigned this Nov 7, 2023
AT*ICT*AWS_SEND=A210 {"A02":"0","A03":"01","A04":"00","A05":"01","A07":"0","A21":"XXXXX","S07":"01","S08":"100","S14":"100"}
…which was zero-padding the remainder of the destination buffer
…ngs as necessary.

This converts a number of string comparison to integer comparisons which should be faster
@mill1000 mill1000 force-pushed the issue/optimizations branch from d19ce9f to 7b02941 Compare November 7, 2023 21:45
@mill1000 mill1000 merged commit b7a9c29 into main Nov 7, 2023
2 checks passed
@mill1000 mill1000 deleted the issue/optimizations branch November 7, 2023 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimize code executed in loop to eliminate warnings
1 participant