GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — node/benchmark/assert/deepequal-object.js at main · synapse/node Expand file tree/ Copy pathdeepequal-object.jsMore file actions 47 lines (41 loc) · 1013 Bytes / Copy pathdeepequal-object.jsFile metadata and controls47 lines (41 loc) · 1013 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 'use strict'; const common = require('../common.js'); const assert = require('assert'); const bench = common.createBenchmark(main, { n: [25, 2e2, 2e3], size: [1e2, 1e3, 1e4], strict: [1], method: ['deepEqual', 'notDeepEqual'], }, { combinationFilter: (p) => { return p.size === 1e4 && p.n === 25 || p.size === 1e3 && p.n === 2e2 || p.size === 1e2 && p.n === 2e3 || p.size === 1; }, }); function createObj(size, add = '') { return Array.from({ length: size }, (n) => ({ foo: 'yarp', nope: { bar: `123${add}`, a: [1, 2, 3], baz: n, c: {}, b: [], }, })); } function main({ size, n, method, strict }) { if (strict) { method = method.replace('eep', 'eepStrict'); } const fn = assert[method]; const actual = createObj(size); const expected = method.includes('not') ? createObj(size, '4') : createObj(size); bench.start(); for (let i = 0; i < n; ++i) { fn(actual, expected); } bench.end(n); } |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |