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

Improve performance of Message#writeHeader

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Minor Minor
    • 4.0
    • None
    • None

      The following stacktrace, taken with JFR, is highlighting a CPU consumer which could be optimised.

      Stack Trace	Sample Count	Percentage(%)
      java.util.IdentityHashMap.get(Object)	66	2.224
         org.jgroups.conf.ClassConfigurator.getMagicNumber(Class)	66	2.224
            org.jgroups.Message.writeHeader(Header, DataOutput)	66	2.224
      

      One idea could be to use an ad-hoc implementation of Map which takes advantage of the key being a Class. An interesting alternative would be to avoid the map lookup altogether, by having the Header expose a method like "writeMagicNumber(DataInput to)".

              rhn-engineering-bban Bela Ban
              sgrinove Sanne Grinovero (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: