Spring Data MongoDB
  1. Spring Data MongoDB
  2. DATAMONGO-520

Spring Data Mongodb performance compared to plain MongoDB driver

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Works as Designed
    • Affects Version/s: 1.1 GA
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None
    • Environment:
      Macbook pro 13, OSX 10.8.1, Core i5, 8GB Ram, SSD

      Description

      Very slow running queries, 10-30 times slower than the native. Details in the discussion on the link to Mongo-db-driver JIRA. I want to understand what my error or a bug in Spring-data.

      1. LoginForm.java
        3 kB
        Ilya Skorik
      2. LoginForm.java
        3 kB
        Ilya Skorik
      3. LoginForm.java
        2 kB
        Ilya Skorik
      4. MongoConfig.java
        1 kB
        Ilya Skorik

        Activity

        Hide
        Ilya Skorik added a comment -

        I added a database dump and test project with pom file. I run mongodb-2.0.7/x64 on macbook pro, OSX 10.8.1

        Tested with Siege http://www.joedog.org/siege-home/ :

        siege http://localhost:9090/zr-matrix/test/1-r 10-c 10-b
        siege http://localhost:9090/zr-matrix/test/2-r 10-c 10-b
        siege http://localhost:9090/zr-matrix/test/3-r 10-c 10-b

        Where test/1 = native, test/2 = spring, test/3 = morphia

        Is that enough?

        Show
        Ilya Skorik added a comment - I added a database dump and test project with pom file. I run mongodb-2.0.7/x64 on macbook pro, OSX 10.8.1 Tested with Siege http://www.joedog.org/siege-home/ : siege http://localhost:9090/zr-matrix/test/1-r 10-c 10-b siege http://localhost:9090/zr-matrix/test/2-r 10-c 10-b siege http://localhost:9090/zr-matrix/test/3-r 10-c 10-b Where test/1 = native, test/2 = spring, test/3 = morphia Is that enough?
        Hide
        Ilya Skorik added a comment -
        Show
        Ilya Skorik added a comment - siege http://localhost:9090/zr-matrix/test/1 -r 10 -c 10 -b siege http://localhost:9090/zr-matrix/test/2 -r 10 -c 10 -b siege http://localhost:9090/zr-matrix/test/3 r 10 c 10 -b
        Hide
        Oliver Gierke added a comment -

        Okay, a last try: I am not going to spend any more time to look through incomplete stuff. I've stated a couple of times already that what we need is a test case I can take and run, and see numbers. Not some arbitrary bunch of code that I'll have to throw into a web container and fiddle around with.

        So expect me to take your project, unzip it, run mvn clean test and see the output you're claiming to be seen. Either you provide something that that fulfills these requirements, or I'll simply close this as not reproducible as we don't have time to spend on a flooded inbox and no progress whatsoever, thanks!

        Show
        Oliver Gierke added a comment - Okay, a last try: I am not going to spend any more time to look through incomplete stuff. I've stated a couple of times already that what we need is a test case I can take and run, and see numbers. Not some arbitrary bunch of code that I'll have to throw into a web container and fiddle around with. So expect me to take your project, unzip it, run mvn clean test and see the output you're claiming to be seen. Either you provide something that that fulfills these requirements, or I'll simply close this as not reproducible as we don't have time to spend on a flooded inbox and no progress whatsoever, thanks!
        Hide
        Ilya Skorik added a comment -

        Dumb test emulating access the controller

        Show
        Ilya Skorik added a comment - Dumb test emulating access the controller
        Hide
        Ilya Skorik added a comment -

        At first I tried to make a stupid test for 100 cycles of database queries, but I did not succeed in this test Spring-data-mongodb fast as analogues.

        I failed do a full emulation of a Spring-mvc web environment, so I emulates requests to controllers.

        In this test, I get the following figures:

        (1) Native driver = 1.8s
        (2) Spring data = 7.2s
        (3) Morphia = 3.6s

        In normal web environment figures are devastating, my stress tests show that a simple controller with a single request is processed several times slower than its implementation on similar frameworks or native driver.

        My knowledge does not allow me to to understand this problem, so I'm just going to use Morphia. You can do with these tests and the task whatever you want.

        Show
        Ilya Skorik added a comment - At first I tried to make a stupid test for 100 cycles of database queries, but I did not succeed in this test Spring-data-mongodb fast as analogues. I failed do a full emulation of a Spring-mvc web environment, so I emulates requests to controllers. In this test, I get the following figures: (1) Native driver = 1.8s (2) Spring data = 7.2s (3) Morphia = 3.6s In normal web environment figures are devastating, my stress tests show that a simple controller with a single request is processed several times slower than its implementation on similar frameworks or native driver. My knowledge does not allow me to to understand this problem, so I'm just going to use Morphia. You can do with these tests and the task whatever you want.

          People

          • Assignee:
            Oliver Gierke
            Reporter:
            Ilya Skorik
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: