Re: RFR: 8263038: Optimize String.format for simple specifiers [v4]

2021-03-08 Thread Claes Redestad
On Mon, 8 Mar 2021 21:42:08 GMT, Naoto Sato wrote: >> Claes Redestad has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Better words > > Looks good! Thank you for reviews, Roger and Naoto! - PR: https://git.openjdk.java.net/j

Re: RFR: 8263038: Optimize String.format for simple specifiers [v4]

2021-03-08 Thread Naoto Sato
On Mon, 8 Mar 2021 20:42:21 GMT, Claes Redestad wrote: >> This patch optimizes String.format expressions that uses trivial specifiers. >> In the JDK, the most common variation of String.format is a variation of >> format("foo: %s", s), which gets a significant speed-up from this. >> >> Various

Re: RFR: 8263038: Optimize String.format for simple specifiers [v4]

2021-03-08 Thread Claes Redestad
> This patch optimizes String.format expressions that uses trivial specifiers. > In the JDK, the most common variation of String.format is a variation of > format("foo: %s", s), which gets a significant speed-up from this. > > Various other cleanups and minor improvements reduce overhead further

Re: RFR: 8263038: Optimize String.format for simple specifiers [v3]

2021-03-08 Thread Naoto Sato
On Mon, 8 Mar 2021 18:52:19 GMT, Claes Redestad wrote: >> This patch optimizes String.format expressions that uses trivial specifiers. >> In the JDK, the most common variation of String.format is a variation of >> format("foo: %s", s), which gets a significant speed-up from this. >> >> Various

Re: RFR: 8263038: Optimize String.format for simple specifiers [v2]

2021-03-08 Thread Claes Redestad
On Mon, 8 Mar 2021 17:23:05 GMT, Naoto Sato wrote: >> Claes Redestad has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Lazily evaluate zero > > src/java.base/share/classes/java/util/Formatter.java line 2447: > >> 2445: private char ze

Re: RFR: 8263038: Optimize String.format for simple specifiers [v3]

2021-03-08 Thread Claes Redestad
> This patch optimizes String.format expressions that uses trivial specifiers. > In the JDK, the most common variation of String.format is a variation of > format("foo: %s", s), which gets a significant speed-up from this. > > Various other cleanups and minor improvements reduce overhead further

Re: RFR: 8263038: Optimize String.format for simple specifiers [v2]

2021-03-08 Thread Naoto Sato
On Mon, 8 Mar 2021 16:00:27 GMT, Claes Redestad wrote: >> This patch optimizes String.format expressions that uses trivial specifiers. >> In the JDK, the most common variation of String.format is a variation of >> format("foo: %s", s), which gets a significant speed-up from this. >> >> Various

Re: RFR: 8263038: Optimize String.format for simple specifiers [v2]

2021-03-08 Thread Roger Riggs
On Mon, 8 Mar 2021 16:00:27 GMT, Claes Redestad wrote: >> This patch optimizes String.format expressions that uses trivial specifiers. >> In the JDK, the most common variation of String.format is a variation of >> format("foo: %s", s), which gets a significant speed-up from this. >> >> Various

Re: RFR: 8263038: Optimize String.format for simple specifiers [v2]

2021-03-08 Thread Claes Redestad
On Fri, 5 Mar 2021 16:36:19 GMT, Roger Riggs wrote: >> Claes Redestad has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Lazily evaluate zero > > Looks good. Piling on another optimization: The `getZero(..)` called eagerly in the construc

Re: RFR: 8263038: Optimize String.format for simple specifiers [v2]

2021-03-08 Thread Claes Redestad
> This patch optimizes String.format expressions that uses trivial specifiers. > In the JDK, the most common variation of String.format is a variation of > format("foo: %s", s), which gets a significant speed-up from this. > > Various other cleanups and minor improvements reduce overhead further

Re: RFR: 8263038: Optimize String.format for simple specifiers

2021-03-08 Thread Roger Riggs
On Mon, 8 Mar 2021 12:10:24 GMT, Claes Redestad wrote: >> I only looked at it because of the updates to use switch expressions... >> ok, either way. > > I had reason to muck around with the switch expressions, since > `Conversion.isValid` was inefficient (for startup) and subtly wrong (accepted

Re: RFR: 8263038: Optimize String.format for simple specifiers

2021-03-08 Thread Claes Redestad
On Fri, 5 Mar 2021 17:08:28 GMT, Roger Riggs wrote: >> I did think about it, but it seemed to stray a bit too far from the intent >> of this enhancement. > > I only looked at it because of the updates to use switch expressions... > ok, either way. I had reason to muck around with the switch exp

Re: RFR: 8263038: Optimize String.format for simple specifiers

2021-03-05 Thread Roger Riggs
On Fri, 5 Mar 2021 17:03:34 GMT, Claes Redestad wrote: >> src/java.base/share/classes/java/util/Formatter.java line 3017: >> >>> 3015: s = ((Character)arg).toString(); >>> 3016: } else if (arg instanceof Byte) { >>> 3017: byte i = (Byte) arg; >> >> Ca

Re: RFR: 8263038: Optimize String.format for simple specifiers

2021-03-05 Thread Claes Redestad
On Fri, 5 Mar 2021 16:36:03 GMT, Roger Riggs wrote: >> This patch optimizes String.format expressions that uses trivial specifiers. >> In the JDK, the most common variation of String.format is a variation of >> format("foo: %s", s), which gets a significant speed-up from this. >> >> Various ot

Re: RFR: 8263038: Optimize String.format for simple specifiers

2021-03-05 Thread Roger Riggs
On Thu, 4 Mar 2021 17:20:40 GMT, Claes Redestad wrote: > This patch optimizes String.format expressions that uses trivial specifiers. > In the JDK, the most common variation of String.format is a variation of > format("foo: %s", s), which gets a significant speed-up from this. > > Various othe

Re: RFR: 8263038: Optimize String.format for simple specifiers

2021-03-04 Thread Claes Redestad
On Thu, 4 Mar 2021 17:20:40 GMT, Claes Redestad wrote: > This patch optimizes String.format expressions that uses trivial specifiers. > In the JDK, the most common variation of String.format is a variation of > format("foo: %s", s), which gets a significant speed-up from this. > > Various othe

RFR: 8263038: Optimize String.format for simple specifiers

2021-03-04 Thread Claes Redestad
This patch optimizes String.format expressions that uses trivial specifiers. In the JDK, the most common variation of String.format is a variation of format("foo: %s", s), which gets a significant speed-up from this. Various other cleanups and minor improvements reduce overhead further and ensu