Uploaded image for project: 'JBoss Remoting'
  1. JBoss Remoting
  2. JBREM-1235

Avoid excessive calls to InetAddress.getLocalHost() [Clone of JBREM-1234]

    Details

    • Type: Quality Risk
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2.2.3.SP2
    • Fix Version/s: 2.2.3.SP3
    • Component/s: None
    • Labels:
      None

      Description

      From JBPAPP-4617 "Possible performance issue in Remoting":

      JMS remote connections that are used locally result in a lot of calls to InetAddress.getLocalHost() which for some reason is slow.

      Why not:
      private static final InetAddress LOCAL_HOST;

      static
      {
      try

      { LOCAL_HOST = InetAddress.getLocalHost(); }

      catch (UnknownHostException e)

      { throw new ExceptionInInitializerError(e); }

      }

      private static InetAddress getLocalHost() throws UnknownHostException

      { return LOCAL_HOST; }

      Which is roughly 1000x faster.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                ron_sigal Ronald Sigal
                Reporter:
                ron_sigal Ronald Sigal
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: