This file contains 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)) |
This file contains 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 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 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 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 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
/* | |
❯ node -v | |
v14.15.1 | |
❯ node Map-vs-native-cache.js | |
Testing caching | |
Map x 57.19 ops/sec ±1.83% (59 runs sampled) | |
Native x 50.16 ops/sec ±2.87% (63 runs sampled) | |
Fastest is Map | |
*/ |
This file contains 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 test = { | |
reasons: [], | |
chunks: [] | |
}; | |
for (var s = 0; s < 5000; s++) { |
This file contains 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 test = []; | |
for (var s = 0; s < 1000000; s++) { | |
test.push(s); | |
} |
This file contains 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
window.onerror = function(message, file, line, column, error) { | |
var errorToReport = { | |
type: error ? error.type : '', | |
message: message, | |
file: file, | |
line: line, | |
column: column, | |
stack: error ? error.stack : '', | |
userAgent: navigator.userAgent, | |
href: location.href |
This file contains 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
Score | |
avif - 0.9132000000000002 | |
webp - 0.8198000000000002 | |
higher better |
OlderNewer