RFR: 8267943: Improve performance of EventWriter by improving varint encoding implementation

Richard Startin github.com+16439049+richardstartin at openjdk.java.net
Tue Jun 1 13:23:30 UTC 2021


This PR improves the performance of committing events with numeric correlation ids by precomputing the number of continuation bytes required by each varint and storing them in a lookup table addressable by the input `long`'s leading zero count. In some rough [benchmarks](https://github.com/richardstartin/jfr-events/blob/master/src/main/java/io/github/richardstartin/jfrevents/CommitEventBenchmark.java), this shows a negligible regression for committing empty events, but a 15% improvement for committing an event with two random 64 bit identifiers.

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

Commit messages:
 - improve performance of EventWriter.putUncheckedLong

Changes: https://git.openjdk.java.net/jdk/pull/4251/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4251&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8267943
  Stats: 55 lines in 1 file changed: 7 ins; 43 del; 5 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4251.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4251/head:pull/4251

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


More information about the hotspot-jfr-dev mailing list