RFR: 8013395 StringBuffer.toString performance regression impacting embedded benchmarks

Florian Weimer fweimer at redhat.com
Mon May 13 10:03:12 UTC 2013


On 05/10/2013 08:03 AM, David Holmes wrote:
> Short version:
>
> Cache the value returned by toString and use it to copy-construct a new
> String on subsequent calls to toString(). Clear the cache on any
> mutating operation.
>
> webrev: http://cr.openjdk.java.net/~dholmes/8013395/webrev.v2/

Shouldn't you clear the cache before the modification, in case the 
modification throws an exception mid-way?  But you cache String (and not 
char[]s), so it's probably not that important.

-- 
Florian Weimer / Red Hat Product Security Team



More information about the core-libs-dev mailing list