[Rev 01] RFR: 5660: Lazy initialize timestamp unit description

Henrik Dafgård hdafgard at openjdk.java.net
Wed Dec 11 17:22:27 UTC 2019


> Creating a string description for each timestamp unit instance is far too expensive since we have to create a new unit for e.g. each duration comparison. So rules that perform such comparisons cause a lot of unnecessary allocations, on my local machine I estimate that this will reduce total allocations by around 50% for rules evaluations.
> 
> This doesn't really fix JMC-5660, but will reduce the performance cost until we get a more proper fix for this bug.

The pull request has been updated with 1 additional commit.

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

Added commits:
 - 13da2bc0: Use AtomicReference for lazy initialization

Changes:
  - all: https://git.openjdk.java.net/jmc/pull/15/files
  - new: https://git.openjdk.java.net/jmc/pull/15/files/0f8c15f7..13da2bc0

Webrevs:
 - full: https://webrevs.openjdk.java.net/jmc/15/webrev.01
 - incr: https://webrevs.openjdk.java.net/jmc/15/webrev.00-01

  Stats: 9 lines in 1 file changed: 1 ins; 2 del; 6 mod
  Patch: https://git.openjdk.java.net/jmc/pull/15.diff
  Fetch: git fetch https://git.openjdk.java.net/jmc pull/15/head:pull/15

PR: https://git.openjdk.java.net/jmc/pull/15


More information about the jmc-dev mailing list