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

Strange performance characteristics of write ops in shell

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Shell
    • None
    • ALL

      Running these two cases shows some unexpectedly huge discrepancy in run time:

      db.user.drop();
      for (var x = 0; x < 10000; x++) {
          db.user.insert({ x: x });
          if (!db.getMongo().useWriteCommands()) {
              db.runCommand({ getLastError: 1 });
          }
      }
      

      raw smoke.py: 4697 ms
      --use-write-commands: 8640 ms

      db.user.drop();
      var bulk = db.user.initializeUnorderedBulkOp();
      for (var x = 0; x < 10000; x++) {
          bulk.insert({ x: x });
      }
      bulk.execute();
      

      raw smoke.py: 4769 ms
      --use-write-commands: 305 ms

        1. Screenshot 2014-03-02 19.24.33.png
          195 kB
          Davide Italiano
        2. Screenshot 2014-03-03 21.36.43.png
          313 kB
          Davide Italiano

            Assignee:
            davide.italiano Davide Italiano
            Reporter:
            randolph@mongodb.com Randolph Tan
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: