Add byte buffer to improve gremlin-python performance#3422
Merged
Conversation
Assisted-by: Devin: Claude Opus 4.7
Cole-Greer
reviewed
May 12, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3422 +/- ##
============================================
- Coverage 77.87% 76.37% -1.50%
+ Complexity 13578 13446 -132
============================================
Files 1015 1013 -2
Lines 59308 60417 +1109
Branches 6835 7091 +256
============================================
- Hits 46184 46142 -42
- Misses 10817 11557 +740
- Partials 2307 2718 +411 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
|
VOTE +1 |
2 similar comments
Contributor
|
VOTE +1 |
Contributor
|
VOTE +1 |
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.
Description
The streaming-support change in #3396 regressed the python CI job from ~5-6 min to 10-19 min and started hitting the 20-min timeout. The root cause is that AiohttpSyncStream.read(n) was running a full asyncio event-loop turn (loop.run_until_complete(...)) for every byte-level read the GraphBinary deserializer performs. A typical response of N results triggers at minimum 3N + 8 reads - for a 5,000-result response that's ~500 ms of pure event-loop overhead vs ~0.5 ms before streaming.
This PR keeps the streaming design intent but pays the asyncio cost at chunk granularity (~64 KB) instead of per byte.
Assisted-by: Devin: Claude Opus 4.7