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

Improve performance of Message#writeHeader

    Details

    • Type: Enhancement
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 4.0
    • Labels:
      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)".

        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: