Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8246260

JFR: Write event size field without padding

XMLWordPrintable

    • jfr
    • b27

      Today the size of an event is written in padded form.

      This means that regardless how of many bytes an event takes up on disk, it uses 4 bytes to represent the size. The reason for this limitation is that the size can not easily be calculated before the event has been written.

      Most events have a size of less than 128 bytes and can be represented using a single byte, so there is about 3 bytes of wasted space per event. This is true for both Java and native events.

      This waste can be avoided by gambling on that an event uses less than 128 bytes and if it is not true, rewrite the event from start and tag the event to be larger than 128 bytes, so the next time an event of the same type is to be written, the penalty will not need to be paid.

      On a SpecJBB2015 run this reduced the size of a recording with about 15%.




            egahlin Erik Gahlin
            egahlin Erik Gahlin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: