[GR-74843] Add IO workload benchmark and minor optimizations.#746
Merged
graalvmbot merged 7 commits intomasterfrom Apr 17, 2026
Merged
[GR-74843] Add IO workload benchmark and minor optimizations.#746graalvmbot merged 7 commits intomasterfrom
graalvmbot merged 7 commits intomasterfrom
Conversation
Cuts copies in TextIOWrapper pending-byte flushes and avoids a buffer slice copy in BufferedWriter flush when writePos is 0. On the jsonrpc-pipe microbenchmark (jvm-ee, mx benchmark micro:jsonrpc-pipe --tracker none -- --python-vm=graalpython --python-vm-config=default --), AVG (no warmup) went from 0.188 s before these changes to 0.089 s after them.
Adds a PosixSupportLibrary readInto primitive and uses it for BufferedReader fill-buffer refills when the raw object is cached PFileIO and the refill starts at offset 0. On the jsonrpc-pipe microbenchmark with a heavier repeated-run protocol (graalpy harness.py micro/jsonrpc-pipe.py -i 12 5000 text text mask 64), the current baseline had median AVG (no warmup) 0.551 s and mean 0.537 s across 5 runs. This change measured median 0.476 s and mean 0.503 s across 5 runs.
The direct buffered readInto refill path caused correctness regressions in\nseek/readline-sensitive code paths. In particular, it broke traceback\nsource extraction and tokenize/linecache-based reads, which reproduced as\nfailing test_traceback assertions and zipimport source-location failures.\n\nRemove the optimization and delete the now-dead PosixSupport readInto\nplumbing until there is a version that preserves buffered IO invariants.
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.
No description provided.