Repository navigation
Conversation
Documentation build overview
17 files changed ·
|
fd7f7ec to
d5def80
Compare
There was a problem hiding this comment.
Looking forward to microbenchmark performance numbers, two high level comments:
-
This pretty comprehensively rewrites
writein TextIOWrapper while adding the newwrite_list. That is intricate and I think should be a PR of its own for reviewability. There's a lot of buffering edgecases and bugfix comments in rewritten code. -
If someone prints 40 million ints comma separated or 16 x 1GB strings this is going to spend a long time building up the list while not printing (and if it OOMs likely never printing). I think there needs to be a
pending_bytes_count > chunk_sizejust like TextIOWrapper's buffering had. Happy for that to be a modern constant default of multi-MB though. Care about the edge cases (ex. printing a list of 16 x 1GB strings) having reasonable behavior.With unintended recursion while developing things tend to run into long accidental strings and often I print() debug to figure out "what is happening".
https://gist.github.com/methane/fb1d38b82ae1934eb19e10dcfef72a08
Most of the changes to textio.c are due to splitting up write(). I've created a separate PR for that part first. |
# Conflicts: # Modules/_io/textio.c
e3f5eaa to
939ee2d
Compare
Use print's existing join and per-part fallback for TextIOWrapper slow paths. Route custom buffers through write() to avoid repeating their closed callback.
939ee2d to
2434c39
Compare
| return self.x | ||
|
|
||
|
|
||
| class RecordingFile: |
There was a problem hiding this comment.
I think there's too much new test added here. RecordingFile and RecordingBytesIO are already models that exist in other I/O tests, want to reuse existing infrastructure and not repeat already exercised cases.
Uh oh!
There was an error while loading. Please reload this page.