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

[PATCH] speed up toJSON()

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 0.10
    • JavaScript View Server
    • None
    • {"couchdb":"Welcome","version":"0.10.0a787397"}

    Description

      This patch is a trivial optimisation of the toJSON() function in main.js

      It provides a surprising speedup. For example, in my real-world app, it reduces indexing time of ~3,800 docs from 80 seconds to 60 seconds. And using the benchmark script I posted to dev@, I see:

      2.877 -> 2.062 secs (3000 docs, emit one k/v per doc)
      13.522 -> 7.585 secs (3000 docs, emit 10 simple k/v per doc)
      19.049 -> 12.714 secs (3000 docs, emit 10 compound k/v per doc)

      Attachments

        1. main.js.patch
          2 kB
          Brian Candler

        Activity

          People

            Unassigned Unassigned
            candlerb Brian Candler
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: