On Sun, 8 Sep 2024 07:52:26 GMT, Shaojin Wen wrote:
> Similar to ObjectInputStream, use JLA.countPositives and
> JLA.inflateBytesToChars to speed up readUTF
Marked as reviewed by bpb (Reviewer).
-
PR Review: https://git.openjdk.org/jdk/pull/20903#pullrequestreview-2316686796
On Sun, 8 Sep 2024 10:05:35 GMT, ExE Boss wrote:
>> Similar to ObjectInputStream, use JLA.countPositives and
>> JLA.inflateBytesToChars to speed up readUTF
>
> src/java.base/share/classes/java/io/DataInputStream.java line 602:
>
>> 600: int ascii = JLA.countPositives(bytearr, 0, utflen)
On Sun, 8 Sep 2024 07:52:26 GMT, Shaojin Wen wrote:
> Similar to ObjectInputStream, use JLA.countPositives and
> JLA.inflateBytesToChars to speed up readUTF
src/java.base/share/classes/java/io/DataInputStream.java line 602:
> 600: int ascii = JLA.countPositives(bytearr, 0, utflen);
> 6
On Mon, 16 Sep 2024 16:41:04 GMT, Shaojin Wen wrote:
>> src/java.base/share/classes/java/io/DataInputStream.java line 590:
>>
>>> 588: if (bytearr == null) {
>>> 589: bytearr = new byte[utflen];
>>> 590: allocate = true;
>>
>> Can we rename this boolean to `trust
On Mon, 16 Sep 2024 13:15:02 GMT, Chen Liang wrote:
>> Similar to ObjectInputStream, use JLA.countPositives and
>> JLA.inflateBytesToChars to speed up readUTF
>
> src/java.base/share/classes/java/io/DataInputStream.java line 590:
>
>> 588: if (bytearr == null) {
>> 589: byte
On Sun, 8 Sep 2024 07:52:26 GMT, Shaojin Wen wrote:
> Similar to ObjectInputStream, use JLA.countPositives and
> JLA.inflateBytesToChars to speed up readUTF
In the readUTFAscii scenario, the performance is significantly improved, but in
the readUTFSmall scenario, the performance is regressed.
On Sun, 8 Sep 2024 07:52:26 GMT, Shaojin Wen wrote:
> Similar to ObjectInputStream, use JLA.countPositives and
> JLA.inflateBytesToChars to speed up readUTF
Thanks for the logical cleanup. I will find another io reviewer too.
Another comment: we currently eagerly allocate a char array, but now