Re: RFR: 8315789: Minor HexFormat performance improvements

2023-09-06 Thread Raffaello Giulietti
On Wed, 6 Sep 2023 13:36:22 GMT, Claes Redestad wrote: > This PR seeks to improve formatting of hex digits using `java.util.HexFormat` > somewhat. > > This is achieved getting rid of a couple of lookup tables, caching the result > of `HexFormat.of().withUpperCase()`, and removing tiny

Re: RFR: 8315789: Minor HexFormat performance improvements

2023-09-08 Thread Raffaello Giulietti
On Wed, 6 Sep 2023 13:36:22 GMT, Claes Redestad wrote: > This PR seeks to improve formatting of hex digits using `java.util.HexFormat` > somewhat. > > This is achieved getting rid of a couple of lookup tables, caching the result > of `HexFormat.of().withUpperCase()`, and removing tiny

Re: RFR: 8316704: Regex-free parsing of Formatter and FormatProcessor specifiers

2023-10-16 Thread Raffaello Giulietti
On Sun, 17 Sep 2023 16:01:33 GMT, Shaojin Wen wrote: > @cl4es made performance optimizations for the simple specifiers of > String.format in PR https://github.com/openjdk/jdk/pull/2830. Based on the > same idea, I continued to make improvements. I made patterns like %2d %02d > also be

Re: RFR: JDK-8316708: Augment WorstCaseTests with more cases

2023-10-16 Thread Raffaello Giulietti
On Fri, 22 Sep 2023 05:36:02 GMT, Joe Darcy wrote: > A new paper > > "Accuracy of Mathematical Functions in Single, Double, Double Extended, and > Quadruple Precision" > by Brian Gladman, Vincenzo Innocente and Paul Zimmermann > https://members.loria.fr/PZimmermann/papers/accuracy.pdf > >

Re: RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) [v19]

2023-10-13 Thread Raffaello Giulietti
On Wed, 11 Oct 2023 15:43:19 GMT, Aggelos Biboudis wrote: >> This is the first draft of a patch for Primitive types in patterns, >> instanceof, and switch (Preview). >> >> Draft spec here: >> https://cr.openjdk.org/~abimpoudis/instanceof/jep443-20231010/specs/instanceof-jls.html > > Aggelos

Re: RFR: 8316704: Regex-free parsing of Formatter and FormatProcessor specifiers

2023-10-16 Thread Raffaello Giulietti
On Mon, 25 Sep 2023 12:20:36 GMT, Shaojin Wen wrote: >>> The reason why I split it into multiple small methods is to avoid a single >>> method codeSize > 325. After merging small methods, the performance will >>> decrease. >> >> Yes, I can refactor to keep the same structure and verify

Re: RFR: 8317993: Add capturing factories to classes in java.util.function package

2023-10-17 Thread Raffaello Giulietti
On Tue, 17 Oct 2023 12:16:54 GMT, ExE Boss wrote: >> This PR proposes to add a number of "capturing factories" in classes in the >> `java.util.function` package. >> >> The PR additionally (an optionally) proposes to add a new function >> `UnaryOperator::andThenUnary` to allow composition

Re: RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) [v21]

2023-10-17 Thread Raffaello Giulietti
On Mon, 16 Oct 2023 19:16:41 GMT, Aggelos Biboudis wrote: >> This is the proposed patch for Primitive types in patterns, instanceof, and >> switch (Preview). >> >> Draft spec here: >> https://cr.openjdk.org/~abimpoudis/instanceof/jep443-20231010/specs/instanceof-jls.html > > Aggelos Biboudis

Re: RFR: 8318200: String::newStringNoRepl and String::getBytesNoRepl does not throw CharacterCodingException [v4]

2023-10-17 Thread Raffaello Giulietti
On Tue, 17 Oct 2023 11:11:52 GMT, Shaojin Wen wrote: >> When calling String::newStringNoRepl and String::getBytesNoRepl, we need to >> use try...catch to handle CharacterCodingException and throw >> IllegalArgumentException instead of CharacterCodingException to make the >> calling code

Re: RFR: 8317993: Add capturing factories to classes in java.util.function package

2023-10-17 Thread Raffaello Giulietti
On Tue, 17 Oct 2023 08:05:09 GMT, Per Minborg wrote: > This PR proposes to add a number of "capturing factories" in classes in the > `java.util.function` package. > > The PR additionally (an optionally) proposes to add a new function > `UnaryOperator::andThenUnary` to allow composition while

Re: RFR: 8317993: Add capturing factories to classes in java.util.function package

2023-10-17 Thread Raffaello Giulietti
On Tue, 17 Oct 2023 13:12:08 GMT, Raffaello Giulietti wrote: >> This PR proposes to add a number of "capturing factories" in classes in the >> `java.util.function` package. >> >> The PR additionally (an optionally) proposes to add a new function >>

Re: RFR: 8316662: Remove one allocation per conversion in Double.toString(double) and Float.toString(float) [v3]

2023-10-27 Thread Raffaello Giulietti
> By correctly sizing an intermediate `byte[]` and making use of the internal > `newStringNoRepl()` method, one allocation per conversion can be avoided when > the runtime uses compact strings. Raffaello Giulietti has updated the pull request with a new target base due to a merge or

RFR: 8318915: Enhance checks in BigDecimal.toPlainString()

2023-11-01 Thread Raffaello Giulietti
Prevent a `NegativeArraySizeException` in `BigDecimal.toPlainString()`, throwing `OutOfMemoryError` instead to indicate that the resulting `String` would be too large. - Commit messages: - 8318915: Enhance checks in BigDecimal.toPlainString() Changes:

Re: RFR: 8319174: Enhance robustness of some j.m.BigInteger constructors [v2]

2023-11-01 Thread Raffaello Giulietti
> Enhance `java.math.BigInteger` constructors taking a `byte[]` argument by > improving guarantees of internal invariants. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Static Random instance. - C

RFR: 8319174: Enhance robustness of some j.m.BigInteger constructors

2023-11-01 Thread Raffaello Giulietti
Enhance `java.math.BigInteger` constructors taking a `byte[]` argument by improving guarantees of internal invariants. - Commit messages: - Added @bug to test. - Refactored test to JUnit. - 8319174: Enhance robustness of some j.m.BigInteger constructors - Merge branch 'master'

Re: RFR: 8319174: Enhance robustness of some j.m.BigInteger constructors [v3]

2023-11-02 Thread Raffaello Giulietti
> Enhance `java.math.BigInteger` constructors taking a `byte[]` argument by > improving guarantees of internal invariants. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Restored ordering of exce

Re: RFR: 8319174: Enhance robustness of some j.m.BigInteger constructors [v3]

2023-11-03 Thread Raffaello Giulietti
On Thu, 2 Nov 2023 22:21:15 GMT, Roger Riggs wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Restored ordering of exceptions. > > src/java.base/share/classes/java/math/BigIn

Re: RFR: 8319174: Enhance robustness of some j.m.BigInteger constructors [v4]

2023-11-03 Thread Raffaello Giulietti
> Enhance `java.math.BigInteger` constructors taking a `byte[]` argument by > improving guarantees of internal invariants. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Better formatting for empty loop

Re: RFR: 8319174: Enhance robustness of some j.m.BigInteger constructors [v5]

2023-11-03 Thread Raffaello Giulietti
> Enhance `java.math.BigInteger` constructors taking a `byte[]` argument by > improving guarantees of internal invariants. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Changed behavior on len == 0. - C

Re: RFR: 8319174: Enhance robustness of some j.m.BigInteger constructors [v3]

2023-11-03 Thread Raffaello Giulietti
On Fri, 3 Nov 2023 09:01:48 GMT, Raffaello Giulietti wrote: >> src/java.base/share/classes/java/math/BigInteger.java line 344: >> >>> 342: * @param len the number of bytes to use. >>> 343: * @throws NumberFormatException {@code va

Re: RFR: 8318915: Enhance checks in BigDecimal.toPlainString() [v2]

2023-11-07 Thread Raffaello Giulietti
On Tue, 7 Nov 2023 18:22:08 GMT, Roger Riggs wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Using repeat() instead of loop. > > src/java.base/share/classes/java/math/BigDeci

Re: RFR: 8318915: Enhance checks in BigDecimal.toPlainString() [v2]

2023-11-07 Thread Raffaello Giulietti
> Prevent a `NegativeArraySizeException` in `BigDecimal.toPlainString()`, > throwing `OutOfMemoryError` instead to indicate that the resulting `String` > would be too large. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last

Re: RFR: 8318646: Integer#parseInt("") throws empty NumberFormatException message [v2]

2023-10-23 Thread Raffaello Giulietti
> Please review this simple fix to restore the original exception message that > existed before [16050](https://github.com/openjdk/jdk/pull/16050). Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Remove 2 extraneous

RFR: 8318646: Integer#parseInt("") throws empty NumberFormatException message

2023-10-23 Thread Raffaello Giulietti
Please review this simple fix to restore the original exception message that existed before [16050](https://github.com/openjdk/jdk/pull/16050). - Commit messages: - Merge branch 'master' into 8318646 - 8318646: Integer#parseInt("") throws empty NumberFormatException message -

Re: RFR: 8313621: test/jdk/jdk/internal/math/FloatingDecimal/TestFloatingDecimal should use RandomFactory [v2]

2023-10-30 Thread Raffaello Giulietti
On Wed, 11 Oct 2023 15:45:29 GMT, Brian Burkhalter wrote: >> Change test to use `RandomFactory` instead of `new Random()` and convert it >> to JUnit 5. > > Brian Burkhalter has updated the pull request incrementally with one > additional commit since the last revision: > > 8313621:

Re: RFR: 8313621: test/jdk/jdk/internal/math/FloatingDecimal/TestFloatingDecimal should use RandomFactory [v3]

2023-10-30 Thread Raffaello Giulietti
On Mon, 30 Oct 2023 17:55:47 GMT, Brian Burkhalter wrote: >> Change test to use `RandomFactory` instead of `new Random()` and convert it >> to JUnit 5. > > Brian Burkhalter has updated the pull request incrementally with one > additional commit since the last revision: > > 8313621:

Re: RFR: 8316704: Regex-free parsing of Formatter and FormatProcessor specifiers

2023-10-17 Thread Raffaello Giulietti
On Sun, 17 Sep 2023 16:01:33 GMT, Shaojin Wen wrote: > @cl4es made performance optimizations for the simple specifiers of > String.format in PR https://github.com/openjdk/jdk/pull/2830. Based on the > same idea, I continued to make improvements. I made patterns like %2d %02d > also be

Re: RFR: 8316662: Remove one allocation per conversion in Double.toString(double) and Float.toString(float) [v2]

2023-09-22 Thread Raffaello Giulietti
> By correctly sizing an intermediate `byte[]` and making use of the internal > `newStringNoRepl()` method, one allocation per conversion can be avoided when > the runtime uses compact strings. Raffaello Giulietti has updated the pull request incrementally with one additional com

Re: RFR: 8316662: Remove one allocation per conversion in Double.toString(double) and Float.toString(float)

2023-09-21 Thread Raffaello Giulietti
On Thu, 21 Sep 2023 12:51:56 GMT, Raffaello Giulietti wrote: > By correctly sizing an intermediate `byte[]` and making use of the internal > `newStringNoRepl()` method, one allocation per conversion can be avoided when > the runtime uses compact strings. On my platform, conversions

RFR: 8316662: Remove one allocation per conversion in Double.toString(double) and Float.toString(float)

2023-09-21 Thread Raffaello Giulietti
By correctly sizing an intermediate `byte[]` and making use of the internal `newStringNoRepl()` method, one allocation per conversion can be avoided when the runtime uses compact strings. - Commit messages: - 8316662: Remove one allocation per conversion in Double.toString(double)

Re: RFR: JDK-8316688: Widen allowable error bound of Math.hypot

2023-09-21 Thread Raffaello Giulietti
On Thu, 21 Sep 2023 19:19:34 GMT, Joe Darcy wrote: > The Math.hypot method claims its error bound is one ulp. > > The paper > > "Accuracy of Mathematical Functions in Single, Double, Double > Extended, and Quadruple Precision" > Brian Gladman, Vincenzo Innocente and Paul Zimmermann > September

Re: RFR: 8316704: Regex-free parsing of Formatter and FormatProcessor specifiers [v13]

2023-09-28 Thread Raffaello Giulietti
On Wed, 27 Sep 2023 21:26:46 GMT, 温绍锦 wrote: >> @cl4es made performance optimizations for the simple specifiers of >> String.format in PR https://github.com/openjdk/jdk/pull/2830. Based on the >> same idea, I continued to make improvements. I made patterns like %2d %02d >> also be optimized.

Re: RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) [v2]

2023-09-28 Thread Raffaello Giulietti
0913/specs/instanceof-jls.html > > Aggelos Biboudis has updated the pull request incrementally with one > additional commit since the last revision: > > Apply suggestions from code review > > Co-authored-by: Raffaello Giulietti There might be good reasons to have: - `byte_

Re: RFR: 8316879: RegionMatches1Tests fails if CompactStrings are disabled after JDK-8302163 [v5]

2023-09-27 Thread Raffaello Giulietti
On Wed, 27 Sep 2023 09:58:58 GMT, Aleksei Voitylov wrote: >> test java.lang.String.RegionMatches1Tests fails on all platforms with >> -XX:-CompactStrings option and on ARM32 where Compact Strings is disabled by >> default. The fix is to return true immediately if len is negative, since for

Re: RFR: 8316879: RegionMatches1Tests fails if CompactStrings are disabled after JDK-8302163 [v5]

2023-09-27 Thread Raffaello Giulietti
On Wed, 27 Sep 2023 09:58:58 GMT, Aleksei Voitylov wrote: >> test java.lang.String.RegionMatches1Tests fails on all platforms with >> -XX:-CompactStrings option and on ARM32 where Compact Strings is disabled by >> default. The fix is to return true immediately if len is negative, since for

Re: RFR: 8316879: RegionMatches1Tests fails if CompactStrings are disabled after JDK-8302163 [v5]

2023-09-27 Thread Raffaello Giulietti
On Wed, 27 Sep 2023 09:58:58 GMT, Aleksei Voitylov wrote: >> test java.lang.String.RegionMatches1Tests fails on all platforms with >> -XX:-CompactStrings option and on ARM32 where Compact Strings is disabled by >> default. The fix is to return true immediately if len is negative, since for

Re: RFR: 8316704: Regex-free parsing of Formatter and FormatProcessor specifiers [v7]

2023-09-27 Thread Raffaello Giulietti
On Mon, 25 Sep 2023 12:20:36 GMT, 温绍锦 wrote: >>> The reason why I split it into multiple small methods is to avoid a single >>> method codeSize > 325. After merging small methods, the performance will >>> decrease. >> >> Yes, I can refactor to keep the same structure and verify performance is

Re: RFR: 8316704: Regex-free parsing of Formatter and FormatProcessor specifiers [v12]

2023-09-27 Thread Raffaello Giulietti
On Wed, 27 Sep 2023 19:13:02 GMT, 温绍锦 wrote: >> @cl4es made performance optimizations for the simple specifiers of >> String.format in PR https://github.com/openjdk/jdk/pull/2830. Based on the >> same idea, I continued to make improvements. I made patterns like %2d %02d >> also be optimized.

Re: RFR: 8316879: RegionMatches1Tests fails if CompactStrings are disabled after JDK-8302163 [v6]

2023-09-27 Thread Raffaello Giulietti
On Wed, 27 Sep 2023 14:13:05 GMT, Aleksei Voitylov wrote: >> test java.lang.String.RegionMatches1Tests fails on all platforms with >> -XX:-CompactStrings option and on ARM32 where Compact Strings is disabled by >> default. The fix is to return true immediately if len is negative, since for

Re: RFR: 8316704: Regex-free parsing of Formatter and FormatProcessor specifiers [v11]

2023-09-27 Thread Raffaello Giulietti
On Wed, 27 Sep 2023 09:35:47 GMT, 温绍锦 wrote: >> @cl4es made performance optimizations for the simple specifiers of >> String.format in PR https://github.com/openjdk/jdk/pull/2830. Based on the >> same idea, I continued to make improvements. I made patterns like %2d %02d >> also be optimized.

Re: RFR: 8316879: RegionMatches1Tests fails if CompactStrings are disabled after JDK-8302163 [v2]

2023-09-26 Thread Raffaello Giulietti
On Tue, 26 Sep 2023 12:38:46 GMT, Aleksei Voitylov wrote: >> test java.lang.String.RegionMatches1Tests fails on all platforms with >> -XX:-CompactStrings option and on ARM32 where Compact Strings is disabled by >> default. The fix is to return true immediately if len is negative, since for

Re: RFR: 8316879: RegionMatches1Tests fails if CompactStrings are disabled after JDK-8302163 [v2]

2023-09-26 Thread Raffaello Giulietti
Since the tests are now TestNG, I think it would make more sense to use TestNG `assertTrue` rather than using explicit `if`s and `throw`s. On 2023-09-26 16:09, Aleksei Voitylov wrote: On Tue, 26 Sep 2023 12:38:46 GMT, Aleksei Voitylov wrote: test java.lang.String.RegionMatches1Tests

Re: RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview)

2023-09-26 Thread Raffaello Giulietti
On Fri, 8 Sep 2023 14:17:29 GMT, Aggelos Biboudis wrote: > This is the first draft of a patch for Primitive types in patterns, > instanceof, and switch (Preview). > > Draft spec here: > https://cr.openjdk.org/~abimpoudis/instanceof/instanceof-20230913/specs/instanceof-jls.html

Re: RFR: 8316879: RegionMatches1Tests fails if CompactStrings are disabled after JDK-8302163 [v4]

2023-09-26 Thread Raffaello Giulietti
On Tue, 26 Sep 2023 16:23:58 GMT, Roger Riggs wrote: >> Aleksei Voitylov has updated the pull request incrementally with one >> additional commit since the last revision: >> >> address review comments > >> test/jdk/java/lang/String/RegionMatches.java was converted to testng and >> split

Re: RFR: JDK-8316708: Augment WorstCaseTests with more cases

2023-09-22 Thread Raffaello Giulietti
On Fri, 22 Sep 2023 05:36:02 GMT, Joe Darcy wrote: > A new paper > > "Accuracy of Mathematical Functions in Single, Double, Double Extended, and > Quadruple Precision" > by Brian Gladman, Vincenzo Innocente and Paul Zimmermann > https://members.loria.fr/PZimmermann/papers/accuracy.pdf > >

Re: RFR: JDK-8316708: Augment WorstCaseTests with more cases

2023-09-22 Thread Raffaello Giulietti
On Fri, 22 Sep 2023 05:36:02 GMT, Joe Darcy wrote: > A new paper > > "Accuracy of Mathematical Functions in Single, Double, Double Extended, and > Quadruple Precision" > by Brian Gladman, Vincenzo Innocente and Paul Zimmermann > https://members.loria.fr/PZimmermann/papers/accuracy.pdf > >

Re: RFR: JDK-8316708: Augment WorstCaseTests with more cases

2023-09-22 Thread Raffaello Giulietti
On Fri, 22 Sep 2023 05:36:02 GMT, Joe Darcy wrote: > A new paper > > "Accuracy of Mathematical Functions in Single, Double, Double Extended, and > Quadruple Precision" > by Brian Gladman, Vincenzo Innocente and Paul Zimmermann > https://members.loria.fr/PZimmermann/papers/accuracy.pdf > >

Re: RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch (Preview) [v2]

2023-09-29 Thread Raffaello Giulietti
0913/specs/instanceof-jls.html > > Aggelos Biboudis has updated the pull request incrementally with one > additional commit since the last revision: > > Apply suggestions from code review > > Co-authored-by: Raffaello Giulietti I just had a reading at the `ExactnessMethods`

Re: RFR: 8316662: Remove one allocation per conversion in Double.toString(double) and Float.toString(float) [v2]

2023-09-29 Thread Raffaello Giulietti
On Fri, 29 Sep 2023 18:56:26 GMT, 温绍锦 wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Uppercase JLA. > > src/java.base/share/classes/jdk/internal/math/DoubleToDecimal.java li

Re: RFR: 8316704: Regex-free parsing of Formatter and FormatProcessor specifiers [v13]

2023-09-28 Thread Raffaello Giulietti
On Wed, 27 Sep 2023 21:26:46 GMT, 温绍锦 wrote: >> @cl4es made performance optimizations for the simple specifiers of >> String.format in PR https://github.com/openjdk/jdk/pull/2830. Based on the >> same idea, I continued to make improvements. I made patterns like %2d %02d >> also be optimized.

Re: RFR: 8316704: Regex-free parsing of Formatter and FormatProcessor specifiers [v12]

2023-09-28 Thread Raffaello Giulietti
On Wed, 27 Sep 2023 19:13:02 GMT, 温绍锦 wrote: >> @cl4es made performance optimizations for the simple specifiers of >> String.format in PR https://github.com/openjdk/jdk/pull/2830. Based on the >> same idea, I continued to make improvements. I made patterns like %2d %02d >> also be optimized.

Re: RFR: 8317515: Unify the code of the parse*() families of methods in j.l.Integer and j.l.Long [v2]

2023-10-05 Thread Raffaello Giulietti
> See the [JBS issue](https://bugs.openjdk.org/browse/JDK-8317515) for the > details. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Avoid localized integers in radix-out-of-range exception messages. - C

Re: RFR: 8317980: Optimization for Integer.parseInt and Long.parseLong

2023-10-12 Thread Raffaello Giulietti
On Thu, 12 Oct 2023 08:58:18 GMT, Chen Liang wrote: >> While only optimizing the fast path is a good idea, I think it is important >> to make sure there is no regression on the slow path - as @schlosna pointed >> out, it's a common way to check if a string can be converted to an int. > > This

Integrated: 8317515: Unify the code of the parse*() families of methods in j.l.Integer and j.l.Long

2023-10-06 Thread Raffaello Giulietti
On Thu, 5 Oct 2023 09:28:22 GMT, Raffaello Giulietti wrote: > See the [JBS issue](https://bugs.openjdk.org/browse/JDK-8317515) for the > details. This pull request has now been integrated. Changeset: b62e774e Author:Raffaello Giulietti URL: https://git.openjdk.org/jdk/

Re: RFR: 8317515: Unify the code of the parse*() families of methods in j.l.Integer and j.l.Long [v3]

2023-10-06 Thread Raffaello Giulietti
> See the [JBS issue](https://bugs.openjdk.org/browse/JDK-8317515) for the > details. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Using compareUnsigned() rather than open logic. - Changes: - all:

Re: RFR: 8317515: Unify the code of the parse*() families of methods in j.l.Integer and j.l.Long [v2]

2023-10-05 Thread Raffaello Giulietti
On Thu, 5 Oct 2023 10:31:31 GMT, Raffaello Giulietti wrote: >> See the [JBS issue](https://bugs.openjdk.org/browse/JDK-8317515) for the >> details. > > Raffaello Giulietti has updated the pull request incrementally with one > additional commit since the last revision: &

RFR: 8317515: Unify the code of the parse*() families of methods in j.l.Integer and j.l.Long

2023-10-05 Thread Raffaello Giulietti
See the [JBS issue](https://bugs.openjdk.org/browse/JDK-8317515) for the details. - Commit messages: - 8317515: Unify the code of the parse*() families of methods in j.l.Integer and j.l.Long Changes: https://git.openjdk.org/jdk/pull/16050/files Webrev:

Re: RFR: 8316704: Regex-free parsing of Formatter and FormatProcessor specifiers [v15]

2023-10-05 Thread Raffaello Giulietti
On Thu, 28 Sep 2023 21:40:17 GMT, 温绍锦 wrote: >> @cl4es made performance optimizations for the simple specifiers of >> String.format in PR https://github.com/openjdk/jdk/pull/2830. Based on the >> same idea, I continued to make improvements. I made patterns like %2d %02d >> also be optimized.

Re: RFR: 8315585: Optimization for decimal to string [v7]

2023-10-19 Thread Raffaello Giulietti
On Wed, 18 Oct 2023 15:59:31 GMT, Claes Redestad wrote: >> Shaojin Wen has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Use StringConcatFactory.makeConcatWithConstants > > I've opened up #16244 for review - thanks for helping with

Re: RFR: 8313621: test/jdk/jdk/internal/math/FloatingDecimal/TestFloatingDecimal should use RandomFactory

2023-10-11 Thread Raffaello Giulietti
On Tue, 10 Oct 2023 23:21:42 GMT, Brian Burkhalter wrote: > Change test to use `RandomFactory` instead of `new Random()` and convert it > to JUnit 5. test/jdk/jdk/internal/math/FloatingDecimal/TestFloatingDecimal.java line 115: > 113: } > 114: > 115: assertTrue(failures ==

Re: RFR: 8316704: Regex-free parsing of Formatter and FormatProcessor specifiers [v3]

2023-10-20 Thread Raffaello Giulietti
On Thu, 19 Oct 2023 06:38:35 GMT, Shaojin Wen wrote: >> @cl4es made performance optimizations for the simple specifiers of >> String.format in PR https://github.com/openjdk/jdk/pull/2830. Based on the >> same idea, I continued to make improvements. I made patterns like %2d %02d >> also be

Re: RFR: 8316704: Regex-free parsing of Formatter and FormatProcessor specifiers [v3]

2023-10-20 Thread Raffaello Giulietti
On Fri, 20 Oct 2023 11:04:28 GMT, Shaojin Wen wrote: >> src/java.base/share/classes/java/util/FormatProcessor.java line 247: >> >>> 245: throw new MissingFormatArgumentException(group + " is >>> not immediately followed by an embedded expression"); >>> 246: } else {

Re: RFR: JDK-8318476: Add resource consumption note to BigInteger and BigDecimal

2023-10-22 Thread Raffaello Giulietti
On Sat, 21 Oct 2023 00:56:21 GMT, Joe Darcy wrote: > Add informative notes to BigInteger and BigDecimal about possible running > times, etc. src/java.base/share/classes/java/math/BigDecimal.java line 310: > 308: * time of operations can screen out {@code BigDecimal} values with > 309: *

Re: RFR: 8317515: Unify the code of the parse*() families of methods in j.l.Integer and j.l.Long [v3]

2023-10-23 Thread Raffaello Giulietti
On Mon, 23 Oct 2023 08:17:43 GMT, Uwe Schindler wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Using compareUnsigned() rather than open logic. > > This caused issue s

Re: RFR: JDK-8318476: Add resource consumption note to BigInteger and BigDecimal [v2]

2023-10-23 Thread Raffaello Giulietti
On Mon, 23 Oct 2023 03:46:54 GMT, Joe Darcy wrote: >> Add informative notes to BigInteger and BigDecimal about possible running >> times, etc. > > Joe Darcy has updated the pull request incrementally with one additional > commit since the last revision: > > Respond to review feedback.

Re: RFR: JDK-8318476: Add resource consumption note to BigInteger and BigDecimal [v2]

2023-10-23 Thread Raffaello Giulietti
On Mon, 23 Oct 2023 09:55:16 GMT, Raffaello Giulietti wrote: >> Joe Darcy has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Respond to review feedback. > > src/java.base/share/classes/java/math/BigIn

Re: RFR: 8316704: Regex-free parsing of Formatter and FormatProcessor specifiers [v15]

2023-10-05 Thread Raffaello Giulietti
On Thu, 28 Sep 2023 21:40:17 GMT, 温绍锦 wrote: >> @cl4es made performance optimizations for the simple specifiers of >> String.format in PR https://github.com/openjdk/jdk/pull/2830. Based on the >> same idea, I continued to make improvements. I made patterns like %2d %02d >> also be optimized.

Re: RFR: 8317515: Unify the code of the parse*() families of methods in j.l.Integer and j.l.Long [v2]

2023-10-06 Thread Raffaello Giulietti
On Fri, 6 Oct 2023 03:06:08 GMT, Quan Anh Mai wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Avoid localized integers in radix-out-of-range exception messages. > > src/jav

Re: RFR: 8317515: Unify the code of the parse*() families of methods in j.l.Integer and j.l.Long [v2]

2023-10-06 Thread Raffaello Giulietti
On Fri, 6 Oct 2023 03:16:50 GMT, Quan Anh Mai wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Avoid localized integers in radix-out-of-range exception messages. > > Could we p

Re: RFR: 8317515: Unify the code of the parse*() families of methods in j.l.Integer and j.l.Long [v2]

2023-10-06 Thread Raffaello Giulietti
On Fri, 6 Oct 2023 10:12:53 GMT, Quan Anh Mai wrote: >> @merykitty For a `String` input that would mean copying the suffix, which >> could be quite long, or make use of the method that accepts a >> `CharSequence`, which has different (although more complete) exception >> messages. Perhaps in

Re: RFR: 8318646: Integer#parseInt("") throws empty NumberFormatException message [v2]

2023-10-24 Thread Raffaello Giulietti
On Mon, 23 Oct 2023 22:15:48 GMT, Uwe Schindler wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Remove 2 extraneous files from commit > > Marked as reviewed by uschindler (Auth

Integrated: 8318646: Integer#parseInt("") throws empty NumberFormatException message

2023-10-24 Thread Raffaello Giulietti
On Mon, 23 Oct 2023 18:04:35 GMT, Raffaello Giulietti wrote: > Please review this simple fix to restore the original exception message that > existed before [16050](https://github.com/openjdk/jdk/pull/16050). This pull request has now been integrated. Changeset: 9bfa0829 Author:Raf

[jdk21] Withdrawn: 8312976: MatchResult produces StringIndexOutOfBoundsException for groups outside match

2023-08-17 Thread Raffaello Giulietti
On Fri, 4 Aug 2023 08:58:46 GMT, Raffaello Giulietti wrote: > Hi all, > > This pull request contains a backport of commit > [61c58fdd](https://github.com/openjdk/jdk/commit/61c58fdd00727da2841a052477e4f4ecfa7094d6) > from the [openjdk/jdk](https://git.openjdk.org/

Re: RFR: 8313961: Enhance identification of special serialization methods

2023-08-21 Thread Raffaello Giulietti
On Mon, 21 Aug 2023 15:46:53 GMT, Raffaello Giulietti wrote: > This improves the identification of the serialization magic fields and > methods. The test is a bit unusual, in that it uses the [Classfile API](https://openjdk.org/jeps/8280389). It is used to generate two classes that

Re: RFR: 8313961: Enhance identification of special serialization methods [v2]

2023-08-21 Thread Raffaello Giulietti
On Mon, 21 Aug 2023 16:13:37 GMT, ExE Boss wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Removed a spurious, unintended file. > > src/java.base/share/classes/java/io/Ob

Re: RFR: 8313961: Enhance identification of special serialization methods [v2]

2023-08-21 Thread Raffaello Giulietti
> This improves the identification of the serialization magic fields and > methods. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Removed a spurious, unintended file. - Changes: - all:

RFR: 8313961: Enhance identification of special serialization methods

2023-08-21 Thread Raffaello Giulietti
This improves the identification of the serialization magic fields and methods. - Commit messages: - 8313961: Enhance identification of special serialization methods - 8313961: Enhance identification of special serialization methods - Merge branch 'master' into 8313961 - 8313961:

RFR: 8314209: Wrong @since tag for RandomGenerator::equiDoubles

2023-08-16 Thread Raffaello Giulietti
Please review this trivial typo. TIA - Commit messages: - 8314209: Wrong @since tag for RandomGenerator::equiDoubles Changes: https://git.openjdk.org/jdk/pull/15303/files Webrev: https://webrevs.openjdk.org/?repo=jdk=15303=00 Issue: https://bugs.openjdk.org/browse/JDK-8314209

Integrated: 8314209: Wrong @since tag for RandomGenerator::equiDoubles

2023-08-16 Thread Raffaello Giulietti
On Wed, 16 Aug 2023 08:07:05 GMT, Raffaello Giulietti wrote: > Please review this trivial typo. > TIA This pull request has now been integrated. Changeset: b80001de Author:Raffaello Giulietti URL: https://git.openjdk.org/jdk/commit/b80001de0c0aeedeb412430660a4727fc26be98b

Re: RFR: 8313961: Enhance identification of special serialization methods

2023-08-23 Thread Raffaello Giulietti
Here's some more context about the issues that the PR attempts to fix. Currently, serialization identifies special "magic" methods by querying classical reflection. It does so by invoking `getDeclaredMethod(name, parametertypes)`. This works correctly under the assumption that a serializable

Re: [External] : Re: Different costs of accessing volatile reference and array

2023-08-16 Thread Raffaello Giulietti
I guess that the cost for an array element access is more expensive than accessing a field, regardless of volatile. The offset is computed at runtime for an array element and might need to be checked to be in the range of valid indices, while the offset of a field is known and can be a

Re: Different costs of accessing volatile reference and array

2023-08-16 Thread Raffaello Giulietti
If I read the data correctly, for the count=100 case in jdk 20 it takes 109 ns/op for the array and 74 ns/op for the field. To me this looks like a field access is _less_ expensive. Am I missing something? On 2023-08-16 13:37, Сергей Цыпанов wrote: Hello, I was measuring costs of hoisting

Re: RFR: JDK-8314489: Add javadoc index entries for java.lang.Math terms

2023-08-17 Thread Raffaello Giulietti
On Thu, 17 Aug 2023 04:52:59 GMT, Joe Darcy wrote: > Use of javadoc search index feature; I'll re-flow paragraphs before pushing > once the wording is agreed to. What about `semi-monotonic` on L.80? Does it deserve to be tagged as `` and indexed? - PR Review:

Re: RFR: JDK-8295391: Add discussion of binary <-> decimal conversion issues [v2]

2023-11-08 Thread Raffaello Giulietti
On Wed, 8 Nov 2023 18:41:15 GMT, Joe Darcy wrote: >> Add discussion of some of the common pitfalls related to decimal <-> binary >> conversion. > > Joe Darcy has updated the pull request incrementally with one additional > commit since the last revision: > > Address issues found by

Integrated: 8318915: Enhance checks in BigDecimal.toPlainString()

2023-11-08 Thread Raffaello Giulietti
On Wed, 1 Nov 2023 17:40:04 GMT, Raffaello Giulietti wrote: > Prevent a `NegativeArraySizeException` in `BigDecimal.toPlainString()`, > throwing `OutOfMemoryError` instead to indicate that the resulting `String` > would be too large. This pull request has now been integrated.

Re: RFR: JDK-8295391: Add discussion of binary <-> decimal conversion issues

2023-11-08 Thread Raffaello Giulietti
On Wed, 8 Nov 2023 17:29:28 GMT, Joe Darcy wrote: > Add discussion of some of the common pitfalls related to decimal <-> binary > conversion. src/java.base/share/classes/java/lang/Double.java line 257: > 255: * // Numeric values listed are exact values > 256: * oneTenthApproxAsFloat =

Re: RFR: 8311906: Improve robustness of String constructors with mutable array inputs

2023-11-08 Thread Raffaello Giulietti
On Mon, 30 Oct 2023 18:34:44 GMT, Roger Riggs wrote: > Strings, after construction, are immutable but may be constructed from > mutable arrays of bytes, characters, or integers. > The string constructors should guard against the effects of mutating the > arrays during construction that might

Re: RFR: 8311906: Improve robustness of String constructors with mutable array inputs [v2]

2023-11-10 Thread Raffaello Giulietti
On Thu, 9 Nov 2023 04:16:25 GMT, Roger Riggs wrote: >> Strings, after construction, are immutable but may be constructed from >> mutable arrays of bytes, characters, or integers. >> The string constructors should guard against the effects of mutating the >> arrays during construction that

Integrated: 8319174: Enhance robustness of some j.m.BigInteger constructors

2023-11-10 Thread Raffaello Giulietti
On Wed, 1 Nov 2023 12:32:24 GMT, Raffaello Giulietti wrote: > Enhance `java.math.BigInteger` constructors taking a `byte[]` argument by > improving guarantees of internal invariants. This pull request has now been integrated. Changeset: a64fc48e Author:Raffaello Giuliett

Re: RFR: 8311906: Improve robustness of String constructors with mutable array inputs [v2]

2023-11-10 Thread Raffaello Giulietti
On Thu, 9 Nov 2023 04:16:25 GMT, Roger Riggs wrote: >> Strings, after construction, are immutable but may be constructed from >> mutable arrays of bytes, characters, or integers. >> The string constructors should guard against the effects of mutating the >> arrays during construction that

Integrated: 8289260: BigDecimal movePointLeft() and movePointRight() do not follow their API spec

2022-07-07 Thread Raffaello Giulietti
On Tue, 28 Jun 2022 10:09:36 GMT, Raffaello Giulietti wrote: > `BigDecimal.morePoint[Left|Right]()` should return the target `this` when the > argument is 0 _and_ the scale is non-negative. This pull request has now been integrated. Changeset: 35387d5c Author:Raffaello Giu

Re: RFR: 8205592: BigDecimal.doubleValue() is depressingly slow

2022-07-08 Thread Raffaello Giulietti
On Thu, 7 Jul 2022 15:20:32 GMT, Raffaello Giulietti wrote: > A reimplementation of `BigDecimal.[double|float]Value()` to enhance > performance, avoiding an intermediate string and its subsequent parsing on > the slow path. These are the improvements over the current implementation

RFR: 8205592: BigDecimal.doubleValue() is depressingly slow

2022-07-08 Thread Raffaello Giulietti
A reimplementation of `BigDecimal.[double|float]Value()` to enhance performance, avoiding an intermediate string and its subsequent parsing on the slow path. - Commit messages: - 8205592: BigDecimal.doubleValue() is depressingly slow Changes:

Re: [jdk19] RFR: 8288596: Random:from() adapter does not delegate to supplied generator in all cases

2022-06-27 Thread Raffaello Giulietti
On Mon, 27 Jun 2022 15:02:36 GMT, Daniel Fuchs wrote: >> Extend delegation by instance returned by Random.from() to all methods >> exposed by RandomGenerator. > > just a stylistic comment in passing: it's a bit strange to see half of the > methods call `this.generator` and the other half

Re: RFR: 8289260: BigDecimal movePointLeft() and movePointRight() do not follow their API spec [v2]

2022-07-04 Thread Raffaello Giulietti
On Tue, 28 Jun 2022 10:32:31 GMT, Raffaello Giulietti wrote: >> `BigDecimal.morePoint[Left|Right]()` should return the target `this` when >> the argument is 0 _and_ the scale is non-negative. > > Raffaello Giulietti has updated the pull request incrementally with one > ad

Integrated: 8288021: Add hard test cases to jdk.internal.math.DoubleToDecimalChecker

2022-06-27 Thread Raffaello Giulietti
On Wed, 8 Jun 2022 13:12:09 GMT, Raffaello Giulietti wrote: > These 19'545 doubles were generated on purpose by Paul Zimmermann of INRIA as > hard test cases. This pull request has now been integrated. Changeset: 354ed103 Author:Raffaello Giulietti Committer: Joe Darcy URL:

Re: RFR: 8289260: BigDecimal movePointLeft() and movePointRight() do not follow their API spec [v2]

2022-06-28 Thread Raffaello Giulietti
> `BigDecimal.morePoint[Left|Right]()` should return the target `this` when the > argument is 0 _and_ the scale is non-negative. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: 8289260: BigDecimal movePoi

RFR: 8289260: BigDecimal movePointLeft() and movePointRight() do not follow their API spec

2022-06-28 Thread Raffaello Giulietti
`BigDecimal.morePoint[Left|Right]()` should return the target `this` when the argument is 0 _and_ the scale is non-negative. - Commit messages: - 8289260: BigDecimal movePointLeft() and movePointRight() do not follow their API spec - 8289260: BigDecimal movePointLeft() and

Re: RFR: 8290079: Reduce interaction with volatile in static initializer of BigInteger

2022-07-12 Thread Raffaello Giulietti
On Mon, 11 Jul 2022 12:41:48 GMT, Сергей Цыпанов wrote: > `BigInteger.powerCache` is volatile and should be assigned only once in > static initializer. (Not a reviewer) While the change doesn't hurt, I doubt that access to a (static) volatile in a static initializer is ever contended.

Re: RFR: 8290079: Reduce interaction with volatile in static initializer of BigInteger

2022-07-12 Thread Raffaello Giulietti
On Mon, 11 Jul 2022 12:41:48 GMT, Сергей Цыпанов wrote: > `BigInteger.powerCache` is volatile and should be assigned only once in > static initializer. Usually yes, but since a static initializer is executed by at most one thread by using a locking protocol before any other static code is

  1   2   3   4   5   6   >