Implement native protocol parsing#273
Draft
antonagestam wants to merge 4 commits intoAiven-Open:mainfrom
Draft
Conversation
616a1e7 to
555a381
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #273 +/- ##
===========================================
- Coverage 100.00% 99.25% -0.75%
===========================================
Files 18 18
Lines 1129 1077 -52
Branches 135 107 -28
===========================================
- Hits 1129 1069 -60
- Misses 0 5 +5
- Partials 0 3 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
0cc80c9 to
5463869
Compare
This is in preparation to replacing Python implementation of protocol parsing with a Rust implementation. To allow zero copy of bytes when passing do from Python to Rust, we need to pass it as read-only objects. By adhering to the Buffer protocol, we're also making sure to maximize compatibility with various network layer implementations. This is a breaking change, users of any reader functions must update their code accordingly and now pass a Buffer + start offset instead of a `io.IO[bytes]` object. Readers return the number of bytes they consume off of the input.
e2a247d to
6d167c5
Compare
6d167c5 to
2fbf1ef
Compare
``` ⦿ python benchmarks/parsing.py ..................... roundtrip: Mean +- std dev: 715 ns +- 8 ns ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This implements the first step for #214: native protocol parsing with readers implemented in Rust.
Needs polishing
maturin developis giving some build warnings.setuptools-scm needs a replacement: research how to do this with maturin. This currently also breaks the Sphinx build.resorted to an ugly hack for now, as the functionality is missing in maturin: https://github.com/antonagestam/kio/blob/2fb221ea9bcfbe639c90dfc0604ba0d98e48a8bc/build_kio.pyIs it a bug in maturin that causesfixed in 77eda35long_descriptionandlong_description_content_typeto be missing? (See the failing twine check)_kio_core.pyimay be out of sync.