On Mar 12, 2014, at 1:45 AM, Peter Levart wrote:

> What would the following cost?
> 
> 
>    private transient String stringCache;
> 
>    public String toString() {
>       […]

This version did not show any significant difference in the benchmark results 
(updated)

http://cr.openjdk.java.net/~bpb/6375303/6375303-bench.html

versus the other approaches. This is not to say that the benchmark is valid for 
any of them. This approach does have the advantage or not using volatile.

Thanks,

Brian

Reply via email to