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

2024-01-21 Thread Shaojin Wen
> I submitted PR #1 before, and there were too many changes. I split it > into multiple PRs with small changes. This one is one of them. > > this PR removed the duplicate code for getChars in > BigDecimal#StringBuilderHelper, i also make performance faster. > Please review and don't

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

2023-12-21 Thread Shaojin Wen
> I submitted PR #1 before, and there were too many changes. I split it > into multiple PRs with small changes. This one is one of them. > > this PR removed the duplicate code for getChars in > BigDecimal#StringBuilderHelper, i also make performance faster. > Please review and don't

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

2023-11-09 Thread Shaojin Wen
> I submitted PR #1 before, and there were too many changes. I split it > into multiple PRs with small changes. This one is one of them. > > this PR removed the duplicate code for getChars in > BigDecimal#StringBuilderHelper, i also make performance faster. > Please review and don't

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

2023-11-09 Thread Shaojin Wen
> I submitted PR #1 before, and there were too many changes. I split it > into multiple PRs with small changes. This one is one of them. > > this PR removed the duplicate code for getChars in > BigDecimal#StringBuilderHelper, i also make performance faster. > Please review and don't

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

2023-10-23 Thread Claes Redestad
On Mon, 23 Oct 2023 11:50:02 GMT, Shaojin Wen wrote: > Can I add scale2 method to StringLatin1? I'd strongly advice against this. > I think this is more readable than using MethodHandle. View the `MethodHandle`s you add to use `StringConcatFactory` here as a temporary workaround before the

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

2023-10-23 Thread Shaojin Wen
On Thu, 19 Oct 2023 11:58:26 GMT, Claes Redestad wrote: >> @cl4es >> >>> Good, narrows it down to what's going on in `prepend(long, byte[], >>> String)`. Might boil down to `System.arraycopy`. This method might not be >>> optimized for tiny arrays on all platforms. Specializing for

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

2023-10-22 Thread Shaojin Wen
On Thu, 19 Oct 2023 10:22:19 GMT, Raffaello Giulietti wrote: >> I've opened up #16244 for review - thanks for helping with analysis and >> verification. > > @cl4es @wenshao I'd like to review the mathematical aspects of these changes > once the refactorings with string concatenations have

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

2023-10-21 Thread Shaojin Wen
> I submitted PR #1 before, and there were too many changes. I split it > into multiple PRs with small changes. This one is one of them. > > this PR removed the duplicate code for getChars in > BigDecimal#StringBuilderHelper, i also make performance faster. > Please review and don't

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

2023-10-21 Thread Shaojin Wen
On Thu, 19 Oct 2023 11:58:26 GMT, Claes Redestad wrote: >> @cl4es >> >>> Good, narrows it down to what's going on in `prepend(long, byte[], >>> String)`. Might boil down to `System.arraycopy`. This method might not be >>> optimized for tiny arrays on all platforms. Specializing for

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

2023-10-20 Thread Shaojin Wen
> I submitted PR #1 before, and there were too many changes. I split it > into multiple PRs with small changes. This one is one of them. > > this PR removed the duplicate code for getChars in > BigDecimal#StringBuilderHelper, i also make performance faster. > Please review and don't

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

2023-10-19 Thread Shaojin Wen
> I submitted PR #1 before, and there were too many changes. I split it > into multiple PRs with small changes. This one is one of them. > > this PR removed the duplicate code for getChars in > BigDecimal#StringBuilderHelper, i also make performance faster. > Please review and don't

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

2023-10-19 Thread Claes Redestad
On Thu, 19 Oct 2023 11:38:57 GMT, Shaojin Wen wrote: > In addition to #16244, will you submit a PR for this? Once both #16244 and this has been integrated I want to revisit this. The effect of changing `getBytes(byte[], int, byte)` might have disappeared with #16244 since it better guarantees

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

2023-10-19 Thread Shaojin Wen
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: 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: 8315585: Optimization for decimal to string [v8]

2023-10-18 Thread Shaojin Wen
> I submitted PR #1 before, and there were too many changes. I split it > into multiple PRs with small changes. This one is one of them. > > this PR removed the duplicate code for getChars in > BigDecimal#StringBuilderHelper, i also make performance faster. > Please review and don't

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

2023-10-18 Thread Claes Redestad
On Mon, 16 Oct 2023 15:00:42 GMT, Shaojin Wen wrote: >> I submitted PR #1 before, and there were too many changes. I split it >> into multiple PRs with small changes. This one is one of them. >> >> this PR removed the duplicate code for getChars in >> BigDecimal#StringBuilderHelper, i

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

2023-10-18 Thread Claes Redestad
On Mon, 16 Oct 2023 15:00:42 GMT, Shaojin Wen wrote: >> I submitted PR #1 before, and there were too many changes. I split it >> into multiple PRs with small changes. This one is one of them. >> >> this PR removed the duplicate code for getChars in >> BigDecimal#StringBuilderHelper, i

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

2023-10-18 Thread Shaojin Wen
On Mon, 16 Oct 2023 15:00:42 GMT, Shaojin Wen wrote: >> I submitted PR #1 before, and there were too many changes. I split it >> into multiple PRs with small changes. This one is one of them. >> >> this PR removed the duplicate code for getChars in >> BigDecimal#StringBuilderHelper, i

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

2023-10-18 Thread Claes Redestad
On Mon, 16 Oct 2023 15:00:42 GMT, Shaojin Wen wrote: >> I submitted PR #1 before, and there were too many changes. I split it >> into multiple PRs with small changes. This one is one of them. >> >> this PR removed the duplicate code for getChars in >> BigDecimal#StringBuilderHelper, i

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

2023-10-17 Thread Shaojin Wen
On Mon, 16 Oct 2023 15:00:42 GMT, Shaojin Wen wrote: >> I submitted PR #1 before, and there were too many changes. I split it >> into multiple PRs with small changes. This one is one of them. >> >> this PR removed the duplicate code for getChars in >> BigDecimal#StringBuilderHelper, i

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

2023-10-17 Thread Chen Liang
On Mon, 16 Oct 2023 15:00:42 GMT, Shaojin Wen wrote: >> I submitted PR #1 before, and there were too many changes. I split it >> into multiple PRs with small changes. This one is one of them. >> >> this PR removed the duplicate code for getChars in >> BigDecimal#StringBuilderHelper, i

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

2023-10-17 Thread Shaojin Wen
On Tue, 17 Oct 2023 15:56:58 GMT, Chen Liang wrote: > Can you export jfr recordings of two different runs to check? How to do this? I don't know how yet - PR Comment: https://git.openjdk.org/jdk/pull/16006#issuecomment-1767448022

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

2023-10-17 Thread Chen Liang
On Mon, 16 Oct 2023 15:00:42 GMT, Shaojin Wen wrote: >> I submitted PR #1 before, and there were too many changes. I split it >> into multiple PRs with small changes. This one is one of them. >> >> this PR removed the duplicate code for getChars in >> BigDecimal#StringBuilderHelper, i

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

2023-10-17 Thread Shaojin Wen
On Mon, 16 Oct 2023 15:00:42 GMT, Shaojin Wen wrote: >> I submitted PR #1 before, and there were too many changes. I split it >> into multiple PRs with small changes. This one is one of them. >> >> this PR removed the duplicate code for getChars in >> BigDecimal#StringBuilderHelper, i

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

2023-10-17 Thread Claes Redestad
On Mon, 16 Oct 2023 15:00:42 GMT, Shaojin Wen wrote: >> I submitted PR #1 before, and there were too many changes. I split it >> into multiple PRs with small changes. This one is one of them. >> >> this PR removed the duplicate code for getChars in >> BigDecimal#StringBuilderHelper, i

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

2023-10-17 Thread Shaojin Wen
On Mon, 16 Oct 2023 15:00:42 GMT, Shaojin Wen wrote: >> I submitted PR #1 before, and there were too many changes. I split it >> into multiple PRs with small changes. This one is one of them. >> >> this PR removed the duplicate code for getChars in >> BigDecimal#StringBuilderHelper, i

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

2023-10-16 Thread Claes Redestad
On Mon, 16 Oct 2023 15:00:42 GMT, Shaojin Wen wrote: >> I submitted PR #1 before, and there were too many changes. I split it >> into multiple PRs with small changes. This one is one of them. >> >> this PR removed the duplicate code for getChars in >> BigDecimal#StringBuilderHelper, i

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

2023-10-16 Thread Shaojin Wen
On Fri, 13 Oct 2023 17:01:11 GMT, Shaojin Wen wrote: >> I submitted PR #1 before, and there were too many changes. I split it >> into multiple PRs with small changes. This one is one of them. >> >> this PR removed the duplicate code for getChars in >> BigDecimal#StringBuilderHelper, i

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

2023-10-16 Thread Shaojin Wen
> I submitted PR #1 before, and there were too many changes. I split it > into multiple PRs with small changes. This one is one of them. > > this PR removed the duplicate code for getChars in > BigDecimal#StringBuilderHelper, i also make performance faster. > Please review and don't

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

2023-10-16 Thread Chen Liang
On Fri, 13 Oct 2023 17:01:11 GMT, Shaojin Wen wrote: >> I submitted PR #1 before, and there were too many changes. I split it >> into multiple PRs with small changes. This one is one of them. >> >> this PR removed the duplicate code for getChars in >> BigDecimal#StringBuilderHelper, i

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

2023-10-16 Thread Claes Redestad
On Fri, 13 Oct 2023 17:01:11 GMT, Shaojin Wen wrote: >> I submitted PR #1 before, and there were too many changes. I split it >> into multiple PRs with small changes. This one is one of them. >> >> this PR removed the duplicate code for getChars in >> BigDecimal#StringBuilderHelper, i

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

2023-10-16 Thread Shaojin Wen
On Fri, 13 Oct 2023 17:01:11 GMT, Shaojin Wen wrote: >> I submitted PR #1 before, and there were too many changes. I split it >> into multiple PRs with small changes. This one is one of them. >> >> this PR removed the duplicate code for getChars in >> BigDecimal#StringBuilderHelper, i

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

2023-10-16 Thread Claes Redestad
On Fri, 13 Oct 2023 17:01:11 GMT, Shaojin Wen wrote: >> I submitted PR #1 before, and there were too many changes. I split it >> into multiple PRs with small changes. This one is one of them. >> >> this PR removed the duplicate code for getChars in >> BigDecimal#StringBuilderHelper, i

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

2023-10-16 Thread Shaojin Wen
On Fri, 13 Oct 2023 17:01:11 GMT, Shaojin Wen wrote: >> I submitted PR #1 before, and there were too many changes. I split it >> into multiple PRs with small changes. This one is one of them. >> >> this PR removed the duplicate code for getChars in >> BigDecimal#StringBuilderHelper, i

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

2023-10-16 Thread Claes Redestad
On Fri, 13 Oct 2023 17:01:11 GMT, Shaojin Wen wrote: >> I submitted PR #1 before, and there were too many changes. I split it >> into multiple PRs with small changes. This one is one of them. >> >> this PR removed the duplicate code for getChars in >> BigDecimal#StringBuilderHelper, i

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

2023-10-15 Thread Shaojin Wen
On Fri, 13 Oct 2023 17:01:11 GMT, Shaojin Wen wrote: >> I submitted PR #1 before, and there were too many changes. I split it >> into multiple PRs with small changes. This one is one of them. >> >> this PR removed the duplicate code for getChars in >> BigDecimal#StringBuilderHelper, i

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

2023-10-15 Thread Claes Redestad
On Fri, 13 Oct 2023 17:01:11 GMT, Shaojin Wen wrote: >> I submitted PR #1 before, and there were too many changes. I split it >> into multiple PRs with small changes. This one is one of them. >> >> this PR removed the duplicate code for getChars in >> BigDecimal#StringBuilderHelper, i

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

2023-10-13 Thread Shaojin Wen
On Fri, 13 Oct 2023 17:01:11 GMT, Shaojin Wen wrote: >> I submitted PR #1 before, and there were too many changes. I split it >> into multiple PRs with small changes. This one is one of them. >> >> this PR removed the duplicate code for getChars in >> BigDecimal#StringBuilderHelper, i

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

2023-10-13 Thread Shaojin Wen
On Fri, 13 Oct 2023 17:01:11 GMT, Shaojin Wen wrote: >> I submitted PR #1 before, and there were too many changes. I split it >> into multiple PRs with small changes. This one is one of them. >> >> this PR removed the duplicate code for getChars in >> BigDecimal#StringBuilderHelper, i

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

2023-10-13 Thread Claes Redestad
On Fri, 13 Oct 2023 17:01:11 GMT, Shaojin Wen wrote: >> I submitted PR #1 before, and there were too many changes. I split it >> into multiple PRs with small changes. This one is one of them. >> >> this PR removed the duplicate code for getChars in >> BigDecimal#StringBuilderHelper, i

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

2023-10-13 Thread Shaojin Wen
> I submitted PR #1 before, and there were too many changes. I split it > into multiple PRs with small changes. This one is one of them. > > this PR removed the duplicate code for getChars in > BigDecimal#StringBuilderHelper, i also make performance faster. > Please review and don't

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

2023-10-13 Thread Claes Redestad
On Thu, 12 Oct 2023 21:49:00 GMT, Shaojin Wen wrote: >> I submitted PR #1 before, and there were too many changes. I split it >> into multiple PRs with small changes. This one is one of them. >> >> this PR removed the duplicate code for getChars in >> BigDecimal#StringBuilderHelper, i

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

2023-10-12 Thread Shaojin Wen
> I submitted PR #1 before, and there were too many changes. I split it > into multiple PRs with small changes. This one is one of them. > > this PR removed the duplicate code for getChars in > BigDecimal#StringBuilderHelper, i also make performance faster. > Please review and don't

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

2023-10-12 Thread Claes Redestad
On Wed, 11 Oct 2023 21:46:04 GMT, Shaojin Wen wrote: >> I submitted PR #1 before, and there were too many changes. I split it >> into multiple PRs with small changes. This one is one of them. >> >> this PR removed the duplicate code for getChars in >> BigDecimal#StringBuilderHelper, i

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

2023-10-12 Thread Claes Redestad
On Wed, 11 Oct 2023 22:19:29 GMT, Shaojin Wen wrote: > Keep the duplicate code of StringConcatHelper, or use JLA, or move the code > of getCharsLatin1 & stringSize to DecimalDigits (PR #15699). Of the three > options, using JLA is the smallest change. Adding methods to JLA also adds a

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

2023-10-11 Thread Shaojin Wen
On Wed, 11 Oct 2023 09:50:20 GMT, Claes Redestad wrote: > I'm not really qualified to review the floating point code. Simplifying away > offset and getting rid of the StringBuilderHelper all seem like good > improvements, though I think it'd be good if we could either avoid or split > out the

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

2023-10-11 Thread Shaojin Wen
On Wed, 11 Oct 2023 22:10:45 GMT, Shaojin Wen wrote: >> src/java.base/share/classes/java/math/BigDecimal.java line 4168: >> >>> 4166: int lowInt = (int)intCompact % 100; >>> 4167: int highInt = (int)intCompact / 100; >>> 4168: int highIntSize =

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

2023-10-11 Thread Shaojin Wen
On Wed, 11 Oct 2023 09:48:58 GMT, Claes Redestad wrote: >> Shaojin Wen has updated the pull request incrementally with one additional >> commit since the last revision: >> >> refactor based on @liach 's review > > src/java.base/share/classes/java/math/BigDecimal.java line 4168: > >> 4166:

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

2023-10-11 Thread Shaojin Wen
> I submitted PR #1 before, and there were too many changes. I split it > into multiple PRs with small changes. This one is one of them. > > this PR removed the duplicate code for getChars in > BigDecimal#StringBuilderHelper, i also make performance faster. > Please review and don't

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

2023-10-11 Thread Shaojin Wen
> I submitted PR #1 before, and there were too many changes. I split it > into multiple PRs with small changes. This one is one of them. > > this PR removed the duplicate code for getChars in > BigDecimal#StringBuilderHelper, i also make performance faster. > Please review and don't

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

2023-10-11 Thread Claes Redestad
On Mon, 9 Oct 2023 19:20:29 GMT, Shaojin Wen wrote: >> I submitted PR #1 before, and there were too many changes. I split it >> into multiple PRs with small changes. This one is one of them. >> >> this PR removed the duplicate code for getChars in >> BigDecimal#StringBuilderHelper, i also

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

2023-10-09 Thread 温绍锦
On Mon, 9 Oct 2023 19:20:29 GMT, 温绍锦 wrote: >> I submitted PR #1 before, and there were too many changes. I split it >> into multiple PRs with small changes. This one is one of them. >> >> this PR removed the duplicate code for getChars in >> BigDecimal#StringBuilderHelper, i also make

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

2023-10-09 Thread 温绍锦
> I submitted PR #1 before, and there were too many changes. I split it > into multiple PRs with small changes. This one is one of them. > > this PR removed the duplicate code for getChars in > BigDecimal#StringBuilderHelper, i also make performance faster, Here are the > numbers run on a

Re: RFR: 8315585: Optimization for decimal to string

2023-10-08 Thread 温绍锦
On Sun, 8 Oct 2023 15:30:00 GMT, Chen Liang wrote: > I think the String concat indy call site already generates code that computes > the size of the char array to be allocated (remember the lengthCoder from > String Concat). We can probably just use `highInt + '.' + >

Re: RFR: 8315585: Optimization for decimal to string

2023-10-08 Thread Chen Liang
On Mon, 2 Oct 2023 05:40:03 GMT, 温绍锦 wrote: > I submitted PR #1 before, and there were too many changes. I split it > into multiple PRs with small changes. This one is one of them. > > this PR removed the duplicate code for getChars in > BigDecimal#StringBuilderHelper, i also make

Re: RFR: 8315585: Optimization for decimal to string

2023-10-04 Thread 温绍锦
On Mon, 2 Oct 2023 05:40:03 GMT, 温绍锦 wrote: > I submitted PR #1 before, and there were too many changes. I split it > into multiple PRs with small changes. This one is one of them. > > this PR removed the duplicate code for getChars in > BigDecimal#StringBuilderHelper, i also make

RFR: 8315585: Optimization for decimal to string

2023-10-04 Thread 温绍锦
I submitted PR #1 before, and there were too many changes. I split it into multiple PRs with small changes. This one is one of them. this PR removed the duplicate code for getChars in BigDecimal#StringBuilderHelper, i also make performance faster, Here are the numbers run on a MacBook M1

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

2023-10-04 Thread 温绍锦
On Fri, 8 Sep 2023 14:50:15 GMT, Claes Redestad wrote: > Seems like a step in the right direction w.r.t. code duplication. There's > still a lot going on in this PR so it'll take some time to digest. Is there > some way to split this into a series of enhancements for easier review? The >

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

2023-09-19 Thread 温绍锦
On Thu, 14 Sep 2023 11:19:08 GMT, 温绍锦 wrote: >> BigDecimal is a commonly used class in business development, It is often >> necessary to perform toString or toPlainString operations on BigDecimal. >> >> The current version uses StringBuilder resulting in multiple memory >> allocations, I made

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

2023-09-14 Thread 温绍锦
> BigDecimal is a commonly used class in business development, It is often > necessary to perform toString or toPlainString operations on BigDecimal. > > The current version uses StringBuilder resulting in multiple memory > allocations, I made a modification to improve performance. > > Because

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

2023-09-12 Thread 温绍锦
> BigDecimal is a commonly used class in business development, It is often > necessary to perform toString or toPlainString operations on BigDecimal. > > The current version uses StringBuilder resulting in multiple memory > allocations, I made a modification to improve performance. > > Because

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

2023-09-09 Thread 温绍锦
> BigDecimal is a commonly used class in business development, It is often > necessary to perform toString or toPlainString operations on BigDecimal. > > The current version uses StringBuilder resulting in multiple memory > allocations, I made a modification to improve performance. > > Because

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

2023-09-09 Thread 温绍锦
> BigDecimal is a commonly used class in business development, It is often > necessary to perform toString or toPlainString operations on BigDecimal. > > The current version uses StringBuilder resulting in multiple memory > allocations, I made a modification to improve performance. > > Because

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

2023-09-08 Thread 温绍锦
> BigDecimal is a commonly used class in business development, It is often > necessary to perform toString or toPlainString operations on BigDecimal. > > The current version uses StringBuilder resulting in multiple memory > allocations, I made a modification to improve performance. > > Because

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

2023-09-08 Thread 温绍锦
On Fri, 8 Sep 2023 18:17:12 GMT, 温绍锦 wrote: >> BigDecimal is a commonly used class in business development, It is often >> necessary to perform toString or toPlainString operations on BigDecimal. >> >> The current version uses StringBuilder resulting in multiple memory >> allocations, I made

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

2023-09-08 Thread 温绍锦
> BigDecimal is a commonly used class in business development, It is often > necessary to perform toString or toPlainString operations on BigDecimal. > > The current version uses StringBuilder resulting in multiple memory > allocations, I made a modification to improve performance. > > Because

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

2023-09-08 Thread 温绍锦
> BigDecimal is a commonly used class in business development, It is often > necessary to perform toString or toPlainString operations on BigDecimal. > > The current version uses StringBuilder resulting in multiple memory > allocations, I made a modification to improve performance. > > Because

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

2023-09-08 Thread 温绍锦
On Fri, 8 Sep 2023 16:25:27 GMT, Roger Riggs wrote: >> I'll have a look at #14655 though I note that @RogerRiggs has already >> commented that this might not carry its own weight. These internal API >> bridges are a nuisance so we need to take care to make sure that any >> addition is

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

2023-09-08 Thread Roger Riggs
On Fri, 8 Sep 2023 15:48:55 GMT, Claes Redestad wrote: >> Going from `jla.newStringNoRepl(bytes, ISO_...)` to >> `jla.newStringLatin1NoRepl(bytes)` isn't much of a code simplification, so >> this distracts a bit from the bulk of the changes in this PR. I agree that >> it *might* help inlining

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

2023-09-08 Thread 温绍锦
On Fri, 8 Sep 2023 15:48:55 GMT, Claes Redestad wrote: >> Going from `jla.newStringNoRepl(bytes, ISO_...)` to >> `jla.newStringLatin1NoRepl(bytes)` isn't much of a code simplification, so >> this distracts a bit from the bulk of the changes in this PR. I agree that >> it *might* help inlining

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

2023-09-08 Thread Claes Redestad
On Fri, 8 Sep 2023 15:41:41 GMT, Claes Redestad wrote: >> Notice there is patch https://github.com/openjdk/jdk/pull/14655 (bug >> 8310901) for converting these usages to a new `newStringLatin1NoRepl`. > > Going from `jla.newStringNoRepl(bytes, ISO_...)` to > `jla.newStringLatin1NoRepl(bytes)`

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

2023-09-08 Thread 温绍锦
> BigDecimal is a commonly used class in business development, It is often > necessary to perform toString or toPlainString operations on BigDecimal. > > The current version uses StringBuilder resulting in multiple memory > allocations, I made a modification to improve performance. > > Because

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

2023-09-08 Thread Claes Redestad
On Fri, 8 Sep 2023 15:39:47 GMT, Chen Liang wrote: >> newStringLatin1NoRepl does not significantly help performance, but it >> simplifies the code. >> >> Of course, there is another advantage: because the call will be simpler, >> making it easier for the caller method to implement codeSize

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

2023-09-08 Thread Chen Liang
On Fri, 8 Sep 2023 15:34:16 GMT, 温绍锦 wrote: >> src/java.base/share/classes/java/lang/String.java line 699: >> >>> 697: } >>> 698: >>> 699: static String newStringLatin1NoRepl(byte[] bytes) { >> >> How much does this help compared to calling `jla.newStringNoRepl(bytes, >>

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

2023-09-08 Thread 温绍锦
On Fri, 8 Sep 2023 12:25:02 GMT, Claes Redestad wrote: >> 温绍锦 has updated the pull request incrementally with one additional commit >> since the last revision: >> >> Continue to optimize and reduce duplicate code > > src/java.base/share/classes/java/lang/String.java line 699: > >> 697:

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

2023-09-08 Thread Claes Redestad
On Fri, 8 Sep 2023 12:00:17 GMT, 温绍锦 wrote: >> BigDecimal is a commonly used class in business development, It is often >> necessary to perform toString or toPlainString operations on BigDecimal. >> >> The current version uses StringBuilder resulting in multiple memory >> allocations, I made

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

2023-09-08 Thread 温绍锦
On Tue, 5 Sep 2023 18:13:39 GMT, Claes Redestad wrote: >> 温绍锦 has updated the pull request with a new target base due to a merge or a >> rebase. The incremental webrev excludes the unrelated changes brought in by >> the merge/rebase. The pull request contains four additional commits since >>

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

2023-09-08 Thread 温绍锦
> BigDecimal is a commonly used class in business development, It is often > necessary to perform toString or toPlainString operations on BigDecimal. > > The current version uses StringBuilder resulting in multiple memory > allocations, I made a modification to improve performance. > > Because

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

2023-09-08 Thread 温绍锦
> BigDecimal is a commonly used class in business development, It is often > necessary to perform toString or toPlainString operations on BigDecimal. > > The current version uses StringBuilder resulting in multiple memory > allocations, I made a modification to improve performance. > > Because

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

2023-09-06 Thread 温绍锦
On Wed, 6 Sep 2023 03:34:04 GMT, 温绍锦 wrote: >> BigDecimal is a commonly used class in business development, It is often >> necessary to perform toString or toPlainString operations on BigDecimal. >> >> The current version uses StringBuilder resulting in multiple memory >> allocations, I made

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

2023-09-06 Thread 温绍锦
> BigDecimal is a commonly used class in business development, It is often > necessary to perform toString or toPlainString operations on BigDecimal. > > The current version uses StringBuilder resulting in multiple memory > allocations, I made a modification to improve performance. > > Because

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

2023-09-05 Thread Joe Darcy
On Wed, 6 Sep 2023 03:34:04 GMT, 温绍锦 wrote: >> BigDecimal is a commonly used class in business development, It is often >> necessary to perform toString or toPlainString operations on BigDecimal. >> >> The current version uses StringBuilder resulting in multiple memory >> allocations, I made

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

2023-09-05 Thread 温绍锦
> BigDecimal is a commonly used class in business development, It is often > necessary to perform toString or toPlainString operations on BigDecimal. > > The current version uses StringBuilder resulting in multiple memory > allocations, I made a modification to improve performance. > > Because

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

2023-09-05 Thread 温绍锦
On Tue, 5 Sep 2023 15:46:17 GMT, 温绍锦 wrote: >> BigDecimal is a commonly used class in business development, It is often >> necessary to perform toString or toPlainString operations on BigDecimal. >> >> The current version uses StringBuilder resulting in multiple memory >> allocations, I made

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

2023-09-05 Thread Claes Redestad
On Tue, 5 Sep 2023 15:46:17 GMT, 温绍锦 wrote: >> BigDecimal is a commonly used class in business development, It is often >> necessary to perform toString or toPlainString operations on BigDecimal. >> >> The current version uses StringBuilder resulting in multiple memory >> allocations, I made

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

2023-09-05 Thread 温绍锦
> BigDecimal is a commonly used class in business development, It is often > necessary to perform toString or toPlainString operations on BigDecimal. > > The current version uses StringBuilder resulting in multiple memory > allocations, I made a modification to improve performance. > > Because

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

2023-09-05 Thread 温绍锦
> BigDecimal is a commonly used class in business development, It is often > necessary to perform toString or toPlainString operations on BigDecimal. > > The current version uses StringBuilder resulting in multiple memory > allocations, I made a modification to improve performance. > > Because

Re: RFR: 8315585: Optimization for decimal to string

2023-09-05 Thread Chen Liang
On Mon, 4 Sep 2023 04:58:08 GMT, 温绍锦 wrote: > BigDecimal is a commonly used class in business development, It is often > necessary to perform toString or toPlainString operations on BigDecimal. > > The current version uses StringBuilder resulting in multiple memory > allocations, I made a

Re: RFR: 8315585: Optimization for decimal to string

2023-09-04 Thread 温绍锦
On Mon, 4 Sep 2023 04:58:08 GMT, 温绍锦 wrote: > BigDecimal is a commonly used class in business development, It is often > necessary to perform toString or toPlainString operations on BigDecimal. > > The current version uses StringBuilder resulting in multiple memory > allocations, I made a

Re: RFR: 8315585: Optimization for decimal to string

2023-09-03 Thread 温绍锦
On Mon, 4 Sep 2023 04:58:08 GMT, 温绍锦 wrote: > BigDecimal is a commonly used class in business development, It is often > necessary to perform toString or toPlainString operations on BigDecimal. > > The current version uses StringBuilder resulting in multiple memory > allocations, I made a

RFR: 8315585: Optimization for decimal to string

2023-09-03 Thread 温绍锦
BigDecimal is a commonly used class in business development, It is often necessary to perform toString or toPlainString operations on BigDecimal. The current version uses StringBuilder resulting in multiple memory allocations, I made a modification to improve performance. Because BigDecimal