Re: RFR: 8282429: StringBuilder/StringBuffer.toString() skip compressing for UTF16 strings [v5]

2022-03-26 Thread Daniel JeliƄski
On Wed, 23 Mar 2022 00:35:14 GMT, Xin Liu wrote: >> If AbstractStringBuilder only grow, the inflated value which has been >> encoded in UTF16 can't be compressed. >> toString() can skip compression in this case. This can save an >> ArrayAllocation in StringUTF16::compress(). >> >>

Re: RFR: 8282429: StringBuilder/StringBuffer.toString() skip compressing for UTF16 strings [v5]

2022-03-22 Thread Xin Liu
> If AbstractStringBuilder only grow, the inflated value which has been encoded > in UTF16 can't be compressed. > toString() can skip compression in this case. This can save an > ArrayAllocation in StringUTF16::compress(). > > java.io.BufferedRead::readLine() is a case that StringBuilder grows