Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-20770

Re-implement shell's DBCommandCursor in C++

    XMLWordPrintable

    Details

      Description

      The shell uses DBCommandCursor to iterate results returned from the "cursor-generating commands" (find, aggregate, listIndexes, listCollections). The implementation is primarily in Javascript:

      https://github.com/mongodb/mongo/blob/bd76599a88e8062c634eeb6918bb30f868bc6042/src/mongo/shell/query.js#L650-L804

      Rewriting this functionality in C++ would most likely make this code run faster. It would also ensure that the shell does not consume excessive memory, since memory required to buffer each batch of results could be reclaimed after the batch is exhausted. Currently, the Javascript engine's garbage collector may not run frequently enough to reclaim memory in a timely manner, especially for queries returning many megabytes worth of results.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated: