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

2025-03-09 Thread Shaojin Wen
On Sat, 1 Feb 2025 08:42:32 GMT, Shaojin Wen wrote: >> Continue to complete PR #16006 and PR #21593 to improve BigDecimal::toString >> and BigDecimal::toPlainString performance and reduce duplicate code > > Shaojin Wen has updated the pull request with a new target base due to a > merge or a re

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

2025-02-07 Thread Paul Sandoz
I would like to amplify this point — undermining Java’s integrity is a big deal. Every time we use unsafe mechanisms within the JDK we risk doing that. The more complex such code is the harder it is reason about whether overall it is safe [*]. We need to balance reasoning about code, quality, an

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

2025-02-07 Thread Archie Cobbs
On Tue, Feb 4, 2025 at 5:26 PM Shaojin Wen wrote: > I think you are talking about the problem of PR #23420, which is caused by > the use of thread-unsafe StringBuilder in multi-threaded scenarios. This > problem is very obscure and I didn't consider it before. I have started to > solve this probl

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

2025-02-04 Thread Shaojin Wen
On Sat, 1 Feb 2025 08:42:32 GMT, Shaojin Wen wrote: >> Continue to complete PR #16006 and PR #21593 to improve BigDecimal::toString >> and BigDecimal::toPlainString performance and reduce duplicate code > > Shaojin Wen has updated the pull request with a new target base due to a > merge or a re

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

2025-02-04 Thread Archie Cobbs
On Tue, Feb 4, 2025 at 2:40 PM Joe Darcy wrote: > Can we please have a pause on the sequence of "make XYZ toString faster" > PRs until there is some wider discussion of goals, etc.? Thanks. > I agree with this sentiment... It was surprising to see how easily a VM crash can sneak in. There is al

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

2025-02-04 Thread Joe Darcy
On Sat, 1 Feb 2025 08:42:32 GMT, Shaojin Wen wrote: >> Continue to complete PR #16006 and PR #21593 to improve BigDecimal::toString >> and BigDecimal::toPlainString performance and reduce duplicate code > > Shaojin Wen has updated the pull request with a new target base due to a > merge or a re

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

2025-02-02 Thread Shaojin Wen
On Sun, 2 Feb 2025 06:58:21 GMT, Johannes Graham wrote: >> Good suggestion, but DecimalDigits no longer provides a pair method > > Right - you’d need to add it back to try this I tested it on a MacBook M1 Max machine and the results were different from what you said. Using StringBuilder + digit

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

2025-02-01 Thread Shaojin Wen
On Sat, 1 Feb 2025 21:04:29 GMT, Johannes Graham wrote: >> Shaojin Wen has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 29 commits: >> >> - Merge remote-tracking branch 'upstream/master' into dec_to_str_202501 >> >># Confl

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

2025-02-01 Thread Johannes Graham
On Sat, 1 Feb 2025 08:42:32 GMT, Shaojin Wen wrote: >> Continue to complete PR #16006 and PR #21593 to improve BigDecimal::toString >> and BigDecimal::toPlainString performance and reduce duplicate code > > Shaojin Wen has updated the pull request with a new target base due to a > merge or a re

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

2025-02-01 Thread Shaojin Wen
> Continue to complete PR #16006 and PR #21593 to improve BigDecimal::toString > and BigDecimal::toPlainString performance and reduce duplicate code Shaojin Wen has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 29 commits: - Merge rem

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 also

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 hesitate

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 a

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 a

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