RFR: 8325340: Add ASCII fast-path to Data-/ObjectInputStream.readUTF

2024-02-13 Thread Claes Redestad
Adding a fast-path for ASCII-only modified UTF-8 strings deserialied via Data- and ObjectInputStream Testing: tier1-3 - Commit messages: - Merge branch 'master' into io_utf8_fastpath - Reduce cost for small Strings in DataInputStream - Optimize away StringBuilder for strings smal

Re: RFR: 8325340: Add ASCII fast-path to Data-/ObjectInputStream.readUTF

2024-02-13 Thread Claes Redestad
On Tue, 6 Feb 2024 16:17:21 GMT, Claes Redestad wrote: > Adding a fast-path for ASCII-only modified UTF-8 strings deserialied via > Data- and ObjectInputStream > > Testing: tier1-3 Benchmark numbers M1 MacBook: NameCnt Base Error Test Error Un

Re: RFR: 8325340: Add ASCII fast-path to Data-/ObjectInputStream.readUTF

2024-02-13 Thread Claes Redestad
On Tue, 6 Feb 2024 18:40:20 GMT, Chen Liang wrote: >> Adding a fast-path for ASCII-only modified UTF-8 strings deserialied via >> Data- and ObjectInputStream >> >> Testing: tier1-3 > > src/java.base/share/classes/java/io/ObjectInputStream.java line 3688: > >> 3686: // a

Re: RFR: 8325340: Add ASCII fast-path to Data-/ObjectInputStream.readUTF

2024-02-13 Thread Chen Liang
On Tue, 6 Feb 2024 16:17:21 GMT, Claes Redestad wrote: > Adding a fast-path for ASCII-only modified UTF-8 strings deserialied via > Data- and ObjectInputStream > > Testing: tier1-3 src/java.base/share/classes/java/io/ObjectInputStream.java line 3688: > 3686: // avoid a

Re: RFR: 8325340: Add ASCII fast-path to Data-/ObjectInputStream.readUTF

2024-02-13 Thread Chen Liang
On Tue, 6 Feb 2024 18:58:01 GMT, Claes Redestad wrote: >> src/java.base/share/classes/java/io/ObjectInputStream.java line 3688: >> >>> 3686: // avoid a redundant scan >>> 3687: String utf = new String(buf, pos, >>> (int)utflen, StandardCharsets.IS

Re: RFR: 8325340: Add ASCII fast-path to Data-/ObjectInputStream.readUTF

2024-02-13 Thread Claes Redestad
On Tue, 6 Feb 2024 23:01:07 GMT, Chen Liang wrote: >> I get warnings and build failures if I leave out those casts (`utflen` is a >> `long`) > > Ah, I meant to use the equivalent local variable int ascii, the return value > of countPositives, to avoid these casts. Missed this comment, but ende

Re: RFR: 8325340: Add ASCII fast-path to Data-/ObjectInputStream.readUTF

2024-02-14 Thread Raffaello Giulietti
On Tue, 6 Feb 2024 16:17:21 GMT, Claes Redestad wrote: > Adding a fast-path for ASCII-only modified UTF-8 strings deserialied via > Data- and ObjectInputStream > > Testing: tier1-3 src/java.base/share/classes/java/io/DataInputStream.java line 585: > 583: DataInputStream dis = null; >

Re: RFR: 8325340: Add ASCII fast-path to Data-/ObjectInputStream.readUTF

2024-02-14 Thread Claes Redestad
On Wed, 14 Feb 2024 10:41:17 GMT, Raffaello Giulietti wrote: >> Adding a fast-path for ASCII-only modified UTF-8 strings deserialied via >> Data- and ObjectInputStream >> >> Testing: tier1-3 > > src/java.base/share/classes/java/io/DataInputStream.java line 604: > >> 602: // Fo

Re: RFR: 8325340: Add ASCII fast-path to Data-/ObjectInputStream.readUTF

2024-02-14 Thread Raffaello Giulietti
On Wed, 14 Feb 2024 11:29:43 GMT, Claes Redestad wrote: >> src/java.base/share/classes/java/io/DataInputStream.java line 604: >> >>> 602: // For ASCII ISO-8859-1 is equivalent to UTF-8, while >>> avoiding a redundant >>> 603: // scan >>> 604: retu

Re: RFR: 8325340: Add ASCII fast-path to Data-/ObjectInputStream.readUTF

2024-02-14 Thread Claes Redestad
On Wed, 14 Feb 2024 11:35:10 GMT, Raffaello Giulietti wrote: >> While properly encoded modified UTF-8 strings won't have embedded zeros >> (`\u` will be encoded as `0xC0, 0x80`) the decoding routines in >> `DataInputStream` and `ObjectInputStream` allows them and does not throw an >> exce

Re: RFR: 8325340: Add ASCII fast-path to Data-/ObjectInputStream.readUTF

2024-02-14 Thread Brian Burkhalter
On Wed, 14 Feb 2024 10:41:08 GMT, Raffaello Giulietti wrote: >> Adding a fast-path for ASCII-only modified UTF-8 strings deserialied via >> Data- and ObjectInputStream >> >> Testing: tier1-3 > > src/java.base/share/classes/java/io/DataInputStream.java line 585: > >> 583: DataInputStre

Re: RFR: 8325340: Add ASCII fast-path to Data-/ObjectInputStream.readUTF

2024-02-14 Thread Brian Burkhalter
On Tue, 6 Feb 2024 16:17:21 GMT, Claes Redestad wrote: > Adding a fast-path for ASCII-only modified UTF-8 strings deserialied via > Data- and ObjectInputStream > > Testing: tier1-3 As there are no regression tests added by this request, I assume that existing tests must sufficiently cover thi

Re: RFR: 8325340: Add ASCII fast-path to Data-/ObjectInputStream.readUTF

2024-02-15 Thread Claes Redestad
On Wed, 14 Feb 2024 20:04:42 GMT, Brian Burkhalter wrote: > As there are no regression tests added by this request, I assume that > existing tests must sufficiently cover this area. If so, however, the issue > has no `noreg-` label. At least for `ObjectInputStream` there's a large and seemingl

Re: RFR: 8325340: Add ASCII fast-path to Data-/ObjectInputStream.readUTF [v2]

2024-02-14 Thread Claes Redestad
> Adding a fast-path for ASCII-only modified UTF-8 strings deserialied via > Data- and ObjectInputStream > > Testing: tier1-3 Claes Redestad has updated the pull request incrementally with one additional commit since the last revision: Refactor to use a shared impl for slow-path mod-UTF8 dec

Re: RFR: 8325340: Add ASCII fast-path to Data-/ObjectInputStream.readUTF [v3]

2024-02-14 Thread Claes Redestad
> Adding a fast-path for ASCII-only modified UTF-8 strings deserialied via > Data- and ObjectInputStream > > Testing: tier1-3 Claes Redestad has updated the pull request incrementally with one additional commit since the last revision: Revert "Refactor to use a shared impl for slow-path mod-

Re: RFR: 8325340: Add ASCII fast-path to Data-/ObjectInputStream.readUTF [v4]

2024-02-15 Thread Claes Redestad
> Adding a fast-path for ASCII-only modified UTF-8 strings deserialied via > Data- and ObjectInputStream > > Testing: tier1-3 Claes Redestad has updated the pull request incrementally with one additional commit since the last revision: Revert changes to DataInputStream - Change

Re: RFR: 8325340: Add ASCII fast-path to Data-/ObjectInputStream.readUTF [v5]

2024-02-15 Thread Claes Redestad
> Adding a fast-path for ASCII-only modified UTF-8 strings deserialied via > Data- and ObjectInputStream > > Testing: tier1-3 Claes Redestad has updated the pull request incrementally with one additional commit since the last revision: Revert spurious formatting changes - Chang

Re: RFR: 8325340: Add ASCII fast-path to Data-/ObjectInputStream.readUTF [v5]

2024-02-15 Thread Claes Redestad
On Thu, 15 Feb 2024 10:33:07 GMT, Claes Redestad wrote: >> Adding a fast-path for ASCII-only modified UTF-8 strings deserialied via >> Data- and ObjectInputStream >> >> Testing: tier1-3 > > Claes Redestad has updated the pull request incrementally with one additional > commit since the last re

Re: RFR: 8325340: Add ASCII fast-path to Data-/ObjectInputStream.readUTF [v5]

2024-02-15 Thread Raffaello Giulietti
On Wed, 14 Feb 2024 14:30:02 GMT, Claes Redestad wrote: >> Ah OK. >> >> I didn't check the current code, only the proposed one. >> Although the specification clearly states that the method should throw, if >> the current code does not throw on zeros, then it makes sense that the >> proposed on

Re: RFR: 8325340: Add ASCII fast-path to Data-/ObjectInputStream.readUTF [v5]

2024-02-15 Thread Raffaello Giulietti
On Thu, 15 Feb 2024 10:55:38 GMT, Raffaello Giulietti wrote: >> The specification is somewhat ambiguous: >> https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/io/DataInput.html#readUTF() >> >> There's a sweeping `Throws UTFDataFormatException - if the bytes do not >> represent a

Re: RFR: 8325340: Add ASCII fast-path to Data-/ObjectInputStream.readUTF [v5]

2024-02-15 Thread Raffaello Giulietti
On Thu, 15 Feb 2024 10:33:07 GMT, Claes Redestad wrote: >> Adding a fast-path for ASCII-only modified UTF-8 strings deserialied via >> Data- and ObjectInputStream >> >> Testing: tier1-3 > > Claes Redestad has updated the pull request incrementally with one additional > commit since the last re

Re: RFR: 8325340: Add ASCII fast-path to Data-/ObjectInputStream.readUTF [v6]

2024-02-15 Thread Claes Redestad
> Adding a fast-path for ASCII-only modified UTF-8 strings deserialied via > Data- and ObjectInputStream > > Testing: tier1-3 Claes Redestad has updated the pull request incrementally with one additional commit since the last revision: Update src/java.base/share/classes/java/io/DataInputStre

Re: RFR: 8325340: Add ASCII fast-path to Data-/ObjectInputStream.readUTF [v6]

2024-02-16 Thread Raffaello Giulietti
On Thu, 15 Feb 2024 13:07:20 GMT, Claes Redestad wrote: >> Adding a fast-path for ASCII-only modified UTF-8 strings deserialied via >> Data- and ObjectInputStream >> >> Testing: tier1-3 > > Claes Redestad has updated the pull request incrementally with one additional > commit since the last re

Re: RFR: 8325340: Add ASCII fast-path to Data-/ObjectInputStream.readUTF [v6]

2024-02-16 Thread Claes Redestad
On Thu, 15 Feb 2024 13:07:20 GMT, Claes Redestad wrote: >> Adding a fast-path for ASCII-only modified UTF-8 strings deserialied via >> Data- and ObjectInputStream >> >> Testing: tier1-3 > > Claes Redestad has updated the pull request incrementally with one additional > commit since the last re

Re: RFR: 8325340: Add ASCII fast-path to Data-/ObjectInputStream.readUTF [v7]

2024-02-16 Thread Claes Redestad
> Adding a fast-path for ASCII-only modified UTF-8 strings deserialied via > Data- and ObjectInputStream > > Testing: tier1-3 Claes Redestad has updated the pull request incrementally with two additional commits since the last revision: - Update test/micro/org/openjdk/bench/java/io/DataInputS

Re: RFR: 8325340: Add ASCII fast-path to Data-/ObjectInputStream.readUTF [v7]

2024-02-16 Thread Raffaello Giulietti
On Fri, 16 Feb 2024 15:31:07 GMT, Claes Redestad wrote: >> Adding a fast-path for ASCII-only modified UTF-8 strings deserialied via >> Data- and ObjectInputStream >> >> Testing: tier1-3 > > Claes Redestad has updated the pull request incrementally with two additional > commits since the last r

Re: RFR: 8325340: Add ASCII fast-path to Data-/ObjectInputStream.readUTF [v7]

2024-02-16 Thread Brian Burkhalter
On Fri, 16 Feb 2024 15:31:07 GMT, Claes Redestad wrote: >> Adding a fast-path for ASCII-only modified UTF-8 strings deserialied via >> Data- and ObjectInputStream >> >> Testing: tier1-3 > > Claes Redestad has updated the pull request incrementally with two additional > commits since the last r

Re: RFR: 8325340: Add ASCII fast-path to Data-/ObjectInputStream.readUTF [v7]

2024-02-26 Thread Roger Riggs
On Fri, 16 Feb 2024 15:31:07 GMT, Claes Redestad wrote: >> Adding a fast-path for ASCII-only modified UTF-8 strings deserialied via >> Data- and ObjectInputStream >> >> Testing: tier1-3 > > Claes Redestad has updated the pull request incrementally with two additional > commits since the last r

Re: RFR: 8325340: Add ASCII fast-path to Data-/ObjectInputStream.readUTF [v7]

2024-02-26 Thread Claes Redestad
On Mon, 26 Feb 2024 15:50:55 GMT, Roger Riggs wrote: >> Claes Redestad has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - Update test/micro/org/openjdk/bench/java/io/DataInputStreamTest.java >> >>Co-authored-by: Raffaello Giuliett

Re: RFR: 8325340: Add ASCII fast-path to Data-/ObjectInputStream.readUTF [v8]

2024-02-26 Thread Claes Redestad
> Adding a fast-path for ASCII-only modified UTF-8 strings deserialied via > Data- and ObjectInputStream > > Testing: tier1-3 Claes Redestad has updated the pull request incrementally with one additional commit since the last revision: Stray space - Changes: - all: https://gi