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

N1ql query result parsing has poor performance for big document

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 1.5.0
    • None
    • N1QL
    • java 8

    Description

      The environment :

      • couchbase server 4.6
      • java client

      on the same machine (dev), plenty of ram, SSD disk, 4 cores

      Simple bucket with only 2 (heavy) documents.
      Simple query select b.* FROM thebucket b

      Execute the query in the couchbase admin : 120 ms
      the same query with the java client : 12 seconds
      the thread doing the computation is using a core at 100%

      the document is huge and badly designed but that's not the point
      the performances should be nearly the same between java and the admin console.

      After investigation the performance bottleneck is in QueryHandler#parseQueryRows > ByteBufJsonHelper#findSectionClosingPosition
      Looks like data in being appended to a buffer but the scan with forEachByte is always done from the beginning of the buffer.

      Attachments

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

        Activity

          People

            daschl Michael Nitschinger
            benoit.wiart Benoit Wiart
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty