Uploaded image for project: 'Apache Cassandra'
  1. Apache Cassandra
  2. CASSANDRA-3286

Performance issue in ByteBufferUtil

Agile BoardAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 1.0.1
    • None
    • None

    Description

      Profiling 1.0 we can see ByteBufferUtil.compareUnsigned is slow.

      Excl. Incl. Incl. Incl. Name 
      User CPU User CPU Sync Wait Sync Wait 
      sec. sec. sec. Count 
      318.491 318.491 1.400 113786 <Total> 
      40.561 40.561 0. 0 <Unknown> 
      18.972 19.093 0. 0 <static>@0xd949 (<libpthread-2.5.so>) 
      17.718 18.730 0. 0 sun.security.provider.MD5.implCompress(byte[], int) 
      14.396 14.396 0. 0 __pthread_cond_signal 
      8.908 8.908 0. 0 org.apache.cassandra.utils.ByteBufferUtil.compareUnsigned(java.nio.ByteBuffer, java.nio.ByteBuffer) 
      7.435 7.688 0. 0 __pthread_cond_timedwait 
      7.127 7.182 0. 0 <static>@0xd8c9 (<libpthread-2.5.so>) 
      7.072 7.072 0. 0 jbyte_disjoint_arraycopy 
      6.764 39.065 0. 0 org.apache.cassandra.utils.ReducingIterator.computeNext() 
      6.533 17.575 0. 0 java.util.concurrent.ConcurrentSkipListMap.doPut(java.lang.Object, java.lang.Object, boolean) 
      6.346 6.346 0. 0 com.sun.crypto.provider.SunJCE_c.a(byte[], int, byte[], int) 
      5.378 5.433 0. 0 send 
      4.861 6.643 0.000 1 org.apache.cassandra.utils.ByteBufferUtil.read(java.io.DataInput, int) 
      4.410 9.260 0. 0 org.apache.commons.collections.iterators.CollatingIterator.least() 
      4.355 4.355 0. 0 java.io.ByteArrayOutputStream.write(int) 
      4.300 6.632 0. 0 java.io.ByteArrayOutputStream.write(byte[], int, int) 
      3.827 30.190 0. 0 org.apache.cassandra.dht.RandomPartitioner.decorateKey(java.nio.ByteBuffer) 
      3.783 23.954 0. 0 org.apache.cassandra.utils.FBUtilities.hash(java.nio.ByteBuffer[]) 
      3.783 3.860 0. 0 <static>@0xd486c (<libc-2.5.so>) 
      3.739 3.739 0. 0 clock_gettime
      

      We can avoid the problem when the ByteBuffer has a backing array

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            tjake T Jake Luciani Assign to me
            tjake T Jake Luciani
            T Jake Luciani
            Jonathan Ellis
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment