Re: RFR: 8327791: Optimization for new BigDecimal(String) [v6]

2024-03-12 Thread Shaojin Wen
On Tue, 12 Mar 2024 09:41:46 GMT, Claes Redestad wrote: >> Shaojin Wen has updated the pull request incrementally with one additional >> commit since the last revision: >> >> easier to compare > > Sorry, when I got pinged in here the earlier comments didn't render and I > missed the conversa

Re: RFR: 8327791: Optimization for new BigDecimal(String) [v6]

2024-03-12 Thread Claes Redestad
On Tue, 12 Mar 2024 06:18:27 GMT, Shaojin Wen wrote: >> The current BigDecimal(String) constructor calls String#toCharArray, which >> has a memory allocation. >> >> >> public BigDecimal(String val) { >> this(val.toCharArray(), 0, val.length()); // allocate char[] >> } >> >> >> When the l

Re: RFR: 8327791: Optimization for new BigDecimal(String) [v6]

2024-03-11 Thread Shaojin Wen
> The current BigDecimal(String) constructor calls String#toCharArray, which > has a memory allocation. > > > public BigDecimal(String val) { > this(val.toCharArray(), 0, val.length()); // allocate char[] > } > > > When the length is greater than 18, create a char[] > > > boolean isCompa