RFR: 8255231: Avoid upcalls when initializing the statSampler [v4]

Claes Redestad redestad at openjdk.java.net
Mon Oct 26 12:49:43 UTC 2020


> 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 with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 21 additional commits since the last revision:

 - Address review comments from David Holmes
 - Merge branch 'master' into com_ns
 - Refactor to remove stable_java_property_counters and clarify comments
 - Merge branch 'master' into com_ns
 - Revert unrelated changes to perfData
 - Merge branch 'master' into com_ns
 - Improve comments
 - typo
 - Missing definition
 - Extract the shorthand java.version from VersionProps and use it in StatSampler
 - ... and 11 more: https://git.openjdk.java.net/jdk/compare/56309bc2...8572159f

-------------

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/802/files
  - new: https://git.openjdk.java.net/jdk/pull/802/files/6e220227..8572159f

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=802&range=03
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=802&range=02-03

  Stats: 172 lines in 14 files changed: 99 ins; 38 del; 35 mod
  Patch: https://git.openjdk.java.net/jdk/pull/802.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/802/head:pull/802

PR: https://git.openjdk.java.net/jdk/pull/802


More information about the core-libs-dev mailing list