This is the subtask of JDK-8151751. We can inject a "source-file" field into Class, and that would skip interning it all the time during stack trace creation. Candidate patch: http://cr.openjdk.java.net/~shade/8216308/webrev.01/ It yields substantial improvements for stack trace generation: Benchmark (depth) Mode Cnt Score Error Units # baseline StackTraceBench.test 1 avgt 15 15.077 ± 0.065 us/op StackTraceBench.test 10 avgt 15 21.153 ± 0.123 us/op StackTraceBench.test 100 avgt 15 80.758 ± 0.363 us/op StackTraceBench.test 1000 avgt 15 674.888 ± 4.985 us/op # patched StackTraceBench.test 1 avgt 15 8.892 ± 0.064 us/op StackTraceBench.test 10 avgt 15 12.010 ± 0.079 us/op StackTraceBench.test 100 avgt 15 43.091 ± 0.254 us/op StackTraceBench.test 1000 avgt 15 353.194 ± 2.040 us/op
|