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

Improve SBE perf for bestbuy_agg_merge_wordcount::all_word_count_no_merge

    • Type: Icon: Task Task
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • Labels:

      When SBE is enabled, the aggregate() command from the all_word_count_no_merge benchmark (from the bestbuy_agg_merge_wordcount suite) is noticeably slower vs. the classic execution engine.

      At the time of this writing, on my local machine this benchmark takes 22243ms when SBE is enabled, compared with 11873ms for the classic execution engine (i.e. SBE disabled).

      Instructions on how to run the aggregate() command:

      1) Download the bestbuy dataset.

      2) Start mongod. If you want to enabled SBE, pass '--setParameter "featureFlagSBE=true"' on the command line.

      3) Load the bestbuy dataset using the following command: 

      mongorestore --gzip --archive=bestbuyproducts.bson.gz

      4) Launch the mongo shell and run the following commands to prepare your environment:

      > function millis(command) { const t1 = new Date(); const result = command(); const t2 = new Date(); print("time: " + (t2 - t1) + "ms"); return (t2-t1); }
      > use bestbuy

       5) Run the following command multiple times to measure the performance of the aggregate() command:

      > millis(() => db.products.aggregate([{"$project":{"wordOfDesc":{"$split":["$longDescription"," "]}}},{"$unwind":"$wordOfDesc"},{"$group":{"_id":"$wordOfDesc","count":{"$sum":1.0}}}]).itcount())

      Note that step #5 above will print out the amount of time the entire "aggregate(..).itcount()" shell command takes from the client's perspective. If you are interested in how long each individual mongo command takes on the server, consider using the slow query timer.

            Assignee:
            andrew.paroski@mongodb.com Drew Paroski
            Reporter:
            andrew.paroski@mongodb.com Drew Paroski
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: