Skip to content

Add byte buffer to improve gremlin-python performance#3422

Merged
xiazcy merged 2 commits into
apache:masterfrom
GumpacG:gha-python-fix
May 13, 2026
Merged

Add byte buffer to improve gremlin-python performance#3422
xiazcy merged 2 commits into
apache:masterfrom
GumpacG:gha-python-fix

Conversation

@GumpacG
Copy link
Copy Markdown
Contributor

@GumpacG GumpacG commented May 12, 2026

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

Assisted-by: Devin: Claude Opus 4.7
Comment thread CHANGELOG.asciidoc Outdated
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.37%. Comparing base (cfd6889) to head (6345172).
⚠️ Report is 1050 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Cole-Greer
Copy link
Copy Markdown
Contributor

VOTE +1

2 similar comments
@kenhuuu
Copy link
Copy Markdown
Contributor

kenhuuu commented May 13, 2026

VOTE +1

@xiazcy
Copy link
Copy Markdown
Contributor

xiazcy commented May 13, 2026

VOTE +1

@xiazcy xiazcy merged commit 8e7f8fb into apache:master May 13, 2026
26 checks passed
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.

5 participants