Uploaded image for project: 'JGroups'
  1. JGroups
  2. JGRP-2043

Improve performance of Message#readHeader

    Details

    • Type: Enhancement
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 4.0
    • Labels:
      None

      Description

      A CPU hot spot highlighed by profiling via JFR:

      Stack Trace	Sample Count	Percentage(%)
      java.lang.reflect.Constructor.newInstance(Object[])	71	2.392
         java.lang.Class.newInstance()	71	2.392
            org.jgroups.Message.readHeader(DataInput)	71	2.392
      

      I'd have expected the reflective constructor to perform well on a recent JVM, but apparently it's not in this case. A theory is that the Class type being unknown makes this code harder to optimise; needs to be looked into.

      It might be possible to patch the ClassConfigurator to provide instances of the required Header type rather than returning the class, and optimise that instead.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  belaban Bela Ban
                  Reporter:
                  sannegrinovero Sanne Grinovero
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: