This repository has been archived by the owner on Oct 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 342
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge 'nodejs/master' into chakracore-master
Sync nodejs/master at 08ea9ee as of 2016-06-14 PR-URL: #79 Reviewed-By: Jianchun Xu <Jianchun.Xu@microsoft.com>
- Loading branch information
Showing
983 changed files
with
71,172 additions
and
5,546 deletions.
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
'use strict'; | ||
const common = require('../common.js'); | ||
|
||
const bench = common.createBenchmark(main, { | ||
pieces: [1, 4, 16], | ||
pieceSize: [1, 16, 256], | ||
withTotalLength: [0, 1], | ||
n: [1024] | ||
}); | ||
|
||
function main(conf) { | ||
const n = +conf.n; | ||
const size = +conf.pieceSize; | ||
const pieces = +conf.pieces; | ||
|
||
const list = new Array(pieces); | ||
list.fill(Buffer.allocUnsafe(size)); | ||
|
||
const totalLength = conf.withTotalLength ? pieces * size : undefined; | ||
|
||
bench.start(); | ||
for (var i = 0; i < n * 1024; i++) { | ||
Buffer.concat(list, totalLength); | ||
} | ||
bench.end(n); | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
'use strict'; | ||
if (process.argv[2] === 'child') | ||
{ | ||
const len = +process.argv[3]; | ||
const msg = `"${'.'.repeat(len)}"`; | ||
while (true) { | ||
process.send(msg); | ||
} | ||
} else { | ||
const common = require('../common.js'); | ||
const bench = common.createBenchmark(main, { | ||
len: [64, 256, 1024, 4096, 32768], | ||
dur: [5] | ||
}); | ||
const spawn = require('child_process').spawn; | ||
function main(conf) { | ||
bench.start(); | ||
|
||
const dur = +conf.dur; | ||
const len = +conf.len; | ||
|
||
const options = { 'stdio': ['ignore', 'ignore', 'ignore', 'ipc'] }; | ||
const child = spawn(process.argv[0], | ||
[process.argv[1], 'child', len], options); | ||
|
||
var bytes = 0; | ||
child.on('message', function(msg) { | ||
bytes += msg.length; | ||
}); | ||
|
||
setTimeout(function() { | ||
child.kill(); | ||
const gbits = (bytes * 8) / (1024 * 1024 * 1024); | ||
bench.end(gbits); | ||
}, dur * 1000); | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
'use strict'; | ||
const common = require('../common.js'); | ||
const url = require('url'); | ||
const v8 = require('v8'); | ||
|
||
const bench = common.createBenchmark(main, { | ||
type: 'one two'.split(' '), | ||
n: [25e6] | ||
}); | ||
|
||
function main(conf) { | ||
const type = conf.type; | ||
const n = conf.n | 0; | ||
|
||
const inputs = { | ||
one: {slashes: true, host: 'localhost'}, | ||
two: {protocol: 'file:', pathname: '/foo'}, | ||
}; | ||
const input = inputs[type] || ''; | ||
|
||
// Force-optimize url.format() so that the benchmark doesn't get | ||
// disrupted by the optimizer kicking in halfway through. | ||
for (const name in inputs) | ||
url.format(inputs[name]); | ||
|
||
v8.setFlagsFromString('--allow_natives_syntax'); | ||
eval('%OptimizeFunctionOnNextCall(url.format)'); | ||
|
||
bench.start(); | ||
for (var i = 0; i < n; i += 1) | ||
url.format(input); | ||
bench.end(n); | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,5 @@ html/*.png | |
*.pyc | ||
|
||
/test/tap/builtin-config | ||
|
||
.nyc_output |
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
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
Oops, something went wrong.