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/misc/util-extend-vs-object-assign.js at master · btd/node Expand file tree/ Copy pathutil-extend-vs-object-assign.jsMore file actions 30 lines (24 loc) · 706 Bytes / Copy pathutil-extend-vs-object-assign.jsFile metadata and controls30 lines (24 loc) · 706 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 'use strict'; const common = require('../common.js'); const util = require('util'); const bench = common.createBenchmark(main, { type: ['extend', 'assign'], n: [10e4] }); function main({ n, type }) { let fn; if (type === 'extend') { fn = util._extend; } else if (type === 'assign') { fn = Object.assign; } // Force-optimize the method to test so that the benchmark doesn't // get disrupted by the optimizer kicking in halfway through. for (let i = 0; i < type.length * 10; i += 1) fn({}, process.env); const obj = new Proxy({}, { set: function(a, b, c) { return true; } }); bench.start(); for (let j = 0; j < n; j += 1) fn(obj, process.env); 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. |