Uploaded image for project: 'Java Couchbase JVM Core'
  1. Java Couchbase JVM Core
  2. JVMCBC-926

Replace new byte[] full copes with ByteBufUtil.getBytes

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1.3
    • Component/s: None
    • Labels:
      None
    • Story Points:
      1

      Description

      We already do it in some places, but we still got plenty of code which does the equivalent of

      byte[] packet = new byte[response.readableBytes()];
       response.readBytes(packet);
      

      This can be simplified and also made faster (it will call into unsafe code that avoids zeroe-ing out the array using an intrinsic) by using ByteBufUtil.getBytes in netty

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

          There are no comments yet on this issue.

            People

            Assignee:
            daschl Michael Nitschinger
            Reporter:
            daschl Michael Nitschinger
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes

                  PagerDuty