Add _.isEqual benchmarks.

Former-commit-id: 5b3ee06ea3f31f10e8fac96da8766cc1c4c2d3bb
This commit is contained in:
John-David Dalton
2012-07-13 04:17:38 -04:00
parent 6c4b4b392b
commit 4f78a06993
2 changed files with 118 additions and 40 deletions

View File

@@ -2698,20 +2698,18 @@
sample = bench.stats.sample;
/**
* Adds a number of clones to the queue.
* Adds a clone to the queue.
*/
function enqueue(count) {
while (count--) {
queue.push(bench.clone({
'_original': bench,
'events': {
'abort': [update],
'cycle': [update],
'error': [update],
'start': [update]
}
}));
}
function enqueue() {
queue.push(bench.clone({
'_original': bench,
'events': {
'abort': [update],
'cycle': [update],
'error': [update],
'start': [update]
}
}));
}
/**
@@ -2817,14 +2815,14 @@
}
// if time permits, increase sample size to reduce the margin of error
if (queue.length < 2 && !maxedOut) {
enqueue(1);
enqueue();
}
// abort the invoke cycle when done
event.aborted = done;
}
// init queue and begin
enqueue(minSamples);
enqueue();
invoke(queue, {
'name': 'run',
'args': { 'async': async },