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

JFR: Reduce use of dynamic proxies

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • 23
    • None
    • hotspot
    • None
    • jfr
    • b22

      JFR uses dynamic proxies to get data, i.e. eventType.getAnnotation(MirrorEvent.class). This is convenient, but for known JDK classes we could get the annotation values directly without spinning up a proxy class, i.e.

      String getMirrorClass() {
        for (var a : eventType.getAnnotationElements()) {
             if (a.getTypeId() == MIRROR_EVENT_TYPE_ID) {
               return (String)a.getValue("value");
             }
         }
         return null;
      }

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

              Created:
              Updated:
              Resolved: