FAQ
Hello list,

I'm testing MongoDB 2.1.0 in order to evaluate the performance of the new
aggregation framework. I'm wondering why it's 2x slower in my use case.

Here is the code I used before version 2.1.0 (using Python and pymongo):

db.customers.group(
{'segment': True},
None,
{'count': 0},
"function (obj, prev) { prev.count ++; }"
)

Here is the same computation using the new aggregation framework:

db.command('aggregate', 'customers', pipeline=[
{'$group' : {
'_id': '$segment',
'count': {'$sum': 1}
}}
])

On my computer and with my dataset, the first version runs in ~1 s, the
second version in ~2.5 s. Is it expected or am I doing something wrong?

Cheers,

Nicolas

--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To view this discussion on the web visit https://groups.google.com/d/msg/mongodb-user/-/UsXhFwSjE0wJ.
To post to this group, send email to mongodb-user@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.

Search Discussions

  • Scott Hernandez at Feb 11, 2012 at 1:55 pm
    The framework is still being developed. Providing feedback with sample
    data, your pipelines and your experiences is good but there are still lots
    of optimizations to be made.

    See the other questions/responses for a list of some of the optimations
    coming.
    On Feb 10, 2012 8:44 PM, "Nicolas Grilly" wrote:

    Hello list,

    I'm testing MongoDB 2.1.0 in order to evaluate the performance of the new
    aggregation framework. I'm wondering why it's 2x slower in my use case.

    Here is the code I used before version 2.1.0 (using Python and pymongo):

    db.customers.group(
    {'segment': True},
    None,
    {'count': 0},
    "function (obj, prev) { prev.count ++; }"
    )

    Here is the same computation using the new aggregation framework:

    db.command('aggregate', 'customers', pipeline=[
    {'$group' : {
    '_id': '$segment',
    'count': {'$sum': 1}
    }}
    ])

    On my computer and with my dataset, the first version runs in ~1 s, the
    second version in ~2.5 s. Is it expected or am I doing something wrong?

    Cheers,

    Nicolas

    --
    You received this message because you are subscribed to the Google Groups
    "mongodb-user" group.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/mongodb-user/-/UsXhFwSjE0wJ.
    To post to this group, send email to mongodb-user@googlegroups.com.
    To unsubscribe from this group, send email to
    mongodb-user+unsubscribe@googlegroups.com.
    For more options, visit this group at
    http://groups.google.com/group/mongodb-user?hl=en.
    --
    You received this message because you are subscribed to the Google Groups "mongodb-user" group.
    To post to this group, send email to mongodb-user@googlegroups.com.
    To unsubscribe from this group, send email to mongodb-user+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
  • Nicolas Grilly at Feb 11, 2012 at 4:13 pm
    Thanks for your answer Scott. I'll redo my tests in a few weeks with the
    next release.
    On Sat, Feb 11, 2012 at 14:54, Scott Hernandez wrote:

    The framework is still being developed. Providing feedback with sample
    data, your pipelines and your experiences is good but there are still lots
    of optimizations to be made.

    See the other questions/responses for a list of some of the optimations
    coming
    --
    You received this message because you are subscribed to the Google Groups "mongodb-user" group.
    To post to this group, send email to mongodb-user@googlegroups.com.
    To unsubscribe from this group, send email to mongodb-user+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
  • Scott Hernandez at Feb 11, 2012 at 4:26 pm
    The first official release will be the 2.2.0 (stable) release.
    Currently this is a developer preview or unstable development release
    depending on who you.

    Here is a little background on versioning and release numbers.
    http://www.mongodb.org/display/DOCSKR/Version+Numbers

    On Sat, Feb 11, 2012 at 11:13 AM, Nicolas Grilly
    wrote:
    Thanks for your answer Scott. I'll redo my tests in a few weeks with the
    next release.

    On Sat, Feb 11, 2012 at 14:54, Scott Hernandez wrote:

    The framework is still being developed. Providing feedback with sample
    data, your pipelines and your experiences is good but there are still lots
    of optimizations to be made.

    See the other questions/responses for a list of some of the optimations
    coming


    --
    You received this message because you are subscribed to the Google Groups
    "mongodb-user" group.
    To post to this group, send email to mongodb-user@googlegroups.com.
    To unsubscribe from this group, send email to
    mongodb-user+unsubscribe@googlegroups.com.
    For more options, visit this group at
    http://groups.google.com/group/mongodb-user?hl=en.
    --
    You received this message because you are subscribed to the Google Groups "mongodb-user" group.
    To post to this group, send email to mongodb-user@googlegroups.com.
    To unsubscribe from this group, send email to mongodb-user+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupmongodb-user @
categoriesmongodb
postedFeb 11, '12 at 1:44a
activeFeb 11, '12 at 4:26p
posts4
users3
websitemongodb.org
irc#mongodb

People

Translate

site design / logo © 2022 Grokbase