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

why cpp/c driver is much slower than java driver when mongodb server is cold?

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 2.4.1
    • Component/s: Internal Client
    • None
    • Environment:
      windows xp x86
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      I need load all documents in a big collection(millions), but only two fields.
      My application is build in java. I don't satisfied with the speed, so I tried cpp and c driver. the result is nice when server is warmed up. But I found when the server is just started, the cpp driver is far slower than java's, the c driver is worse.

      btw: it's a covered query, but without hint it will be a basic cursor. What confused me is when I add a hint, it will be slower despite indexOnly is true. @.@

      The benchmark(approximate):

      lang cold warm
      java 48s 6s
      cpp 200s 2s
      c 400s 3s

      I wonder how this happens?
      Can you explain it? How to improve it?
      Thanks

            Assignee:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Reporter:
            kobevaliant kobevaliant
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: