RFR: 8305959: x86: Improve itable_stub [v6]
Aleksey Shipilev
shade at openjdk.org
Mon Jun 5 19:07:24 UTC 2023
On Mon, 5 Jun 2023 10:10:22 GMT, Boris Ulasevich <bulasevich at openjdk.org> wrote:
>> Async profiler shows that applications spend up to 10% in itable_stubs.
>>
>> The current inefficiency of itable stubs is as follows. The generated itable_stub scans itable twice: first it checks if the object class is a subtype of the resolved_class, and then it finds the holder_class that implements the method. I suggest doing this in one pass: with a first loop over itable, check pointer equality to both holder_class and resolved_class. Once we have finished searching for resolved_class, continue searching for holder_class in a separate loop if it has not yet been found.
>>
>> This approach gives 1-10% improvement on the synthetic benchmarks and 3% improvement on Naive Bayes benchmark from the Renaissance Benchmark Suite (Intel Xeon X5675).
>
> Boris Ulasevich has updated the pull request incrementally with one additional commit since the last revision:
>
> push/pop(temp_get) -> push/pop(rdx)
I measured the last PR on `c6.8xlarge`:
Benchmark Mode Cnt Score Error Units
# Baseline
InterfaceCalls.test1stInt2Types avgt 12 1.582 ± 0.098 ns/op
InterfaceCalls.test1stInt3Types avgt 12 6.218 ± 0.001 ns/op
InterfaceCalls.test1stInt5Types avgt 12 6.220 ± 0.004 ns/op
InterfaceCalls.test2ndInt2Types avgt 12 2.215 ± 0.004 ns/op
InterfaceCalls.test2ndInt3Types avgt 12 7.590 ± 0.008 ns/op
InterfaceCalls.test2ndInt5Types avgt 12 7.591 ± 0.004 ns/op
InterfaceCalls.testIfaceCall avgt 12 6.238 ± 0.006 ns/op
InterfaceCalls.testIfaceExtCall avgt 12 8.389 ± 0.500 ns/op
InterfaceCalls.testMonomorphic avgt 12 1.035 ± 0.001 ns/op
# Patched
InterfaceCalls.test1stInt2Types avgt 12 1.476 ± 0.001 ns/op ; +7.2%
InterfaceCalls.test1stInt3Types avgt 12 5.848 ± 0.012 ns/op ; +6.3%
InterfaceCalls.test1stInt5Types avgt 12 5.842 ± 0.009 ns/op ; +6.4%
InterfaceCalls.test2ndInt2Types avgt 12 2.213 ± 0.001 ns/op ; <wash>
InterfaceCalls.test2ndInt3Types avgt 12 6.548 ± 0.002 ns/op ; +15.9%
InterfaceCalls.test2ndInt5Types avgt 12 6.549 ± 0.003 ns/op ; +15.9%
InterfaceCalls.testIfaceCall avgt 12 5.872 ± 0.007 ns/op ; +6.2%
InterfaceCalls.testIfaceExtCall avgt 12 6.589 ± 0.008 ns/op ; +27.3% (high noise)
InterfaceCalls.testMonomorphic avgt 12 1.035 ± 0.001 ns/op ; <wash>
-------------
PR Comment: https://git.openjdk.org/jdk/pull/13460#issuecomment-1577320318
More information about the hotspot-dev
mailing list