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

Slow performance on duplicate key exception

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.2.2
    • Component/s: Performance
    • Labels:
      None

      While doing testing with C++ driver, I noticed that when all
      keys were duplicates the performance was way slower.
      Doesnt make sense since it's not supposed to do work in that case...

      I tried with the very simple loop in js, and gives even worse result:

      var start = new Date();
      for (var count = 0; count < 1000000; ++count) {
      db.foo.insert({_id: count});
      }
      print(new Date() - start);

      Collection is empty:
      antoine@ag410:~/Downloads/mongodb-linux-x86_64-2.2.2$ ./bin/mongo
      ~/adobe/testwrites.js
      MongoDB shell version: 2.2.2
      connecting to: test
      12527

      2nd run without dropping:
      antoine@ag410:~/Downloads/mongodb-linux-x86_64-2.2.2$ ./bin/mongo
      ~/adobe/testwrites.js
      MongoDB shell version: 2.2.2
      connecting to: test
      78153

      this is reproducible always..

        1. dups.pdf
          17 kB
          Antoine Girbal
        2. stacks.txt
          24 kB
          Antoine Girbal

            Assignee:
            mathias@mongodb.com Mathias Stearn
            Reporter:
            antoine Antoine Girbal
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: