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

Eliminate looping, message reparsing in codec with take_until #274

Merged
merged 2 commits into from
May 20, 2021

Conversation

ebkalderon
Copy link
Owner

Added

  • Add encode_message() helper function to reduce boilerplate in codec tests.

Changes

  • Make parse error recovery for incoming messages more efficient, exploit SIMD acceleration using take_until().
  • Improve codec unit test coverage for catching parse errors.

@ebkalderon ebkalderon self-assigned this May 20, 2021
This commit changes `LanguageServerCodec` to recover from parse failures
more efficiently. Using nom's SIMD-accelerated `take_until()`
combinator, we can skip forward in the byte stream much more
efficiently and without any message reparsing nor looping necessary.
This commit adds a helper function for encoding test LSP messages and
expands codec test coverage, checking for more parse errors.
@ebkalderon ebkalderon force-pushed the eliminate-message-reparsing-in-codec branch from 0233a9c to c537596 Compare May 20, 2021 18:24
@ebkalderon ebkalderon merged commit 696d673 into master May 20, 2021
@ebkalderon ebkalderon deleted the eliminate-message-reparsing-in-codec branch May 20, 2021 18:59
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.

None yet

1 participant