XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.4.6
    • None
    • java client
    • None

    Description

      Just happened to notice Utils.bufEquals(byte[], byte[]) as a rather large outlier (~7% CPU time) when running with an attached profiler.

      By just simply switching the implementation to delegate directly to Arrays.equals(byte[], byte[]) the invocation disappears from the profile. The reason for this is that this is one of the methods which the JIT (not the interpreter) will generate an intrinsic for, using the builtin support of the CPU to do the check.

      The fix is trivial

          public static boolean bufEquals(byte onearray[], byte twoarray[] ) {
             return Arrays.equals(onearray, twoarray);
          }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            chelin Charlie Helin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: