This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Benchmark = require('benchmark'); | |
var suite = new Benchmark.Suite; | |
var testObject = {}; | |
for (var s = 0; s < 1000; s++) { | |
testObject[s] = Math.floor(Math.random() * 10000); | |
} | |
console.log('Testing iteration of object') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Benchmark = require('benchmark'); | |
var suite = new Benchmark.Suite; | |
var testArray = []; | |
for (var s = 0; s < 1000; s++) { | |
testArray.push(s * 2); | |
} | |
suite |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Benchmark = require('benchmark'); | |
var expect = require('expect'); | |
var _ = require('lodash'); | |
var R = require('ramda'); | |
var suite = new Benchmark.Suite; | |
var testArray = [ | |
{ items: [{status: 'new', payload: [1, 2, 3]}, {status: 'old'}, {status: 'new', payload: [2, 1, 4]}]}, | |
{ items: [{status: 'new', payload: [8, 2, 7]}, {status: 'new', payload: [0, 2, 9]}, {status: 'old'}]}, | |
{ items: [{status: 'old'}, {status: 'new', payload: [5, 2, 3]}, {status: 'new', payload: [1, 4, 3]}]} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Benchmark = require('benchmark'); | |
var expect = require('expect'); | |
var _ = require('lodash'); | |
var R = require('ramda'); | |
var suite = new Benchmark.Suite; | |
var testArray = [1,2,3,4,5,6,7,8,9,10,11,12,13]; | |
var resultat = [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26]; | |
suite |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Benchmark = require('benchmark'); | |
var expect = require('expect'); | |
var suite = new Benchmark.Suite; | |
var testArray = [1,2,3,4,5,6,7,8,9,10,11,12,13]; | |
var resultat = [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26]; | |
suite | |
.add('forHoley', () => forHoley(testArray)) | |
.add('forPush', () => forPush(testArray)) |
NewerOlder