RFR: 8255231: Avoid upcalls when initializing the statSampler [v2]
Ioi Lam
iklam at openjdk.java.net
Sat Oct 24 05:16:38 UTC 2020
On Thu, 22 Oct 2020 11:28:22 GMT, Claes Redestad <redestad at openjdk.org> wrote:
>> Current implementation of the statSampler does upcalls to System.getProperty to collect values for a number of properties that are all provided by the VM itself. And since the sampling starts before any user code run then no property can have changed.
>>
>> I suggest refactoring the code so that no upcalls are made normally - while asserting this invariant holds using assert-only upcalls.
>>
>> This is a small startup optimization - reducing the startup sequence by approx. 300k instructions and 70k branches in my linux-x64 setup.
>
> Claes Redestad has updated the pull request incrementally with one additional commit since the last revision:
>
> Revert unrelated changes to perfData
Looks good to me. A nice clean up.
src/hotspot/share/runtime/statSampler.cpp line 217:
> 215: */
> 216:
> 217: // stable interface, supported counters in the JAVA_PROPERTY name space
* The list of System Properties that have corresponding PerfData
* string instrumentation created by retrieving the named property's
* value from System.getProperty() and unconditionally creating a
* PerfStringConstant object initialized to the retrieved value. This
* is not an exhaustive list of Java properties with corresponding string
* instrumentation as the create_system_property_instrumentation() method
* creates other property based instrumentation conditionally.
I found the above comment unreadable. Is it possible to clarify it?
-------------
Marked as reviewed by iklam (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/802
More information about the hotspot-dev
mailing list