RFR: 5660: Lazy initialize timestamp unit description

Henrik Dafgård hdafgard at openjdk.java.net
Wed Dec 11 15:23:59 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.

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

Commits:
 - 0f8c15f7: Fix formatting
 - e888d1a1: Lazy initialization of TimestampUnit description to reduce allocation pressure from rules evaluation

Changes: https://git.openjdk.java.net/jmc/pull/15/files
 Webrev: https://webrevs.openjdk.java.net/jmc/15/webrev.00
  Issue: https://bugs.openjdk.java.net/browse/JMC-5660
  Stats: 8 lines in 1 file changed: 5 ins; 1 del; 2 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