You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently there is no way to read from or write to a RubyIO without creating a RubyString and accompanying ByteList. Meanwhile we have many places where we want to write a ByteList or even just a byte[] with a given encoding, such as IOOutputStream or the copy_stream logic for non-files.
We should build and use read and write paths that accept at least ByteList and ideally byte[], start, length, encoding to avoid allocation altogether.
This might be a good beginner to intermediate task for an external contributor.
The text was updated successfully, but these errors were encountered:
Several Java-based consumers of RubyIO write to it without having
a RubyString in hand, by wrapping incoming byte[] or ByteList.
This patch adds a write path that can accept unwrapped byte[] plus
encoding to reduce allocation and follow a fast path.
Users that hit this logic, mostly via IOOutputStream:
* The Psych ext when dumping to an IO
* For stdout and stderr streams provided by Ruby.getError/OutputStream
* By Marshal for dumping to a target IO or IO-like
* By GzipWriter for writing to a stream
* Anyone that calls to_outputstream on an IO
Part of work for jruby#6589
Currently there is no way to read from or write to a RubyIO without creating a RubyString and accompanying ByteList. Meanwhile we have many places where we want to write a ByteList or even just a byte[] with a given encoding, such as IOOutputStream or the copy_stream logic for non-files.
We should build and use read and write paths that accept at least ByteList and ideally byte[], start, length, encoding to avoid allocation altogether.
This might be a good beginner to intermediate task for an external contributor.
The text was updated successfully, but these errors were encountered: