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

Improve performance of Message#writeHeader

    XMLWordPrintable

Details

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

    Description

      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)".

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: