RFR: 8013395 StringBuffer.toString performance regression impacting embedded benchmarks (original) (raw)
Florian Weimer fweimer at redhat.com
Mon May 13 10:03:12 UTC 2013
- Previous message: RFR: 8013395 StringBuffer.toString performance regression impacting embedded benchmarks
- Next message: RFR [7021870] GzipInputStream closes underlying stream during reading
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: RFR: 8013395 StringBuffer.toString performance regression impacting embedded benchmarks
- Next message: RFR [7021870] GzipInputStream closes underlying stream during reading
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]