Uploaded image for project: 'CouchDB'
  1. CouchDB
  2. COUCHDB-2732

Use thread local storage for couch_ejson_compare NIF

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.0
    • Component/s: None
    • Labels:
      None

      Description

      Some folks inside IBM have demonstrated conclusively that the NIF we use for JSON sorting is a significant bottleneck with more than a few concurrent users hitting us. The VM ends up spending all of its time dealing with lock contention. We'd be better off sticking with the pure Erlang code, but we have an even better alternative, which is to use thread local storage to pin an allocator to each OS thread and eliminate the locks.

      Patch forthcoming, but I wanted to make sure this got in the tracker. The improvement looks really signficant. Interestingly, there was some discussion about a performance regression after this was introduced back in COUCHDB-1186 ... maybe the missing element in that discussion was the client concurrency?

        Attachments

          Activity

            People

            • Assignee:
              kocolosk Adam Kocoloski
              Reporter:
              kocolosk Adam Kocoloski
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: