Skip to content

Commit

Permalink
PERF-819 Create agg perf tests for on unwind followed by streaming stage
Browse files Browse the repository at this point in the history
  • Loading branch information
jameswahlin committed Dec 22, 2016
1 parent 94fb5bb commit 7dcf1f5
Showing 1 changed file with 50 additions and 4 deletions.
54 changes: 50 additions & 4 deletions testcases/pipelines.js
Expand Up @@ -759,12 +759,9 @@ generateTestCase({

generateTestCase({
name: "UnwindThenGroup",
// TODO (PERF-805): When the throughput of this test has improved, re-tag it back into the
// regression suite.
noRegression: true,
docGenerator: function simpleUnwindDocGenerator(i) {
var largeArray = [];
for (var j = 0; j < 1000; j++) {
for (var j = 0; j < 50; j++) {
largeArray.push(getStringOfLength(10) + j);
}
return {
Expand All @@ -775,3 +772,52 @@ generateTestCase({
},
pipeline: [{$unwind: "$array"}, {$group: {_id: "$array", count: {$sum: 1}}}]
});

generateTestCase({
name: "UnwindThenMatch",
docGenerator: function simpleUnwindDocGenerator(i) {
var valArray = [];
for (var j = 0; j < 30; j++) {
valArray.push(j%10);
}
return {
_id: i,
array: valArray,
smallString: getStringOfLength(10)
};
},
pipeline: [{$unwind: {path: "$array"}}, {$match: {array: 5}}]
});


generateTestCase({
name: "UnwindThenSort",
docGenerator: function simpleUnwindDocGenerator(i) {
var valArray = [];
for (var j = 0; j < 10; j++) {
valArray.push(getStringOfLength(10) + j);
}
return {
_id: i,
array: valArray,
smallString: getStringOfLength(10)
};
},
pipeline: [{$unwind: {path: "$array"}}, {$sort: {array: -1}}]
});

generateTestCase({
name: "UnwindThenSkip",
docGenerator: function simpleUnwindDocGenerator(i) {
var valArray = [];
for (var j = 0; j < 10; j++) {
valArray.push(getStringOfLength(10) + j);
}
return {
_id: i,
array: valArray,
smallString: getStringOfLength(10)
};
},
pipeline: [{$unwind: {path: "$array"}}, {$skip: 10}]
});

0 comments on commit 7dcf1f5

Please sign in to comment.