Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 0.42
    • Fix Version/s: 0.701.4
    • Component/s: Perl driver
    • Labels:
      None
    • Environment:
      debian on a xeon E5405 (8 core) with 16G of memory and SSD disk
    • # Replies:
      10
    • Last comment by Customer:
      true

      Description

      Perl driver is very, very, very slow compared to PHP one...

      Doing some tests with perl 5.10.1 and perl 5.12.3 show that PHP is between 2.8 to more than 3.2 times faster for basic insertions (without or with threads enabled).

      In PHP case, mongod reach 100% and PHP stay around 57% CPU. 10M insertions done in ~100 seconds.

      In Perl case, mongodb stay around 76% while Perl is at 100% CPU ! 10M insertions done in ~280 seconds (threaded perl) or ~320 seconds (original, debian threaded perl).

      I join the 2 sample scripts and a little patch that avoid calling sprintf() 12 times for each insertion. In the test case, 10% of exec time was spent in sprintf. With it we gain 10% of total time, not much, but better than nothing...

        Attachments

        1. insert.php
          0.4 kB
        2. insert.pl
          0.6 kB
        3. without-sprintf.patch
          0.7 kB

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Days since reply:
                3 years, 4 weeks, 2 days ago
                Date of 1st Reply: