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

2025-01-29 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 27 commits: - copyright

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 maintena

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 = JLA.stringSize(

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 [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 per

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 M

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