Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
Merge nodejs/master
Browse files Browse the repository at this point in the history
Merge 2f34bf0 as of 2017-06-14.
This is an automatically created merge. For any problems please
contact @kunalspathak.
  • Loading branch information
kfarnung committed Jun 20, 2017
2 parents a090a7d + 2f34bf0 commit 6d7f46e
Show file tree
Hide file tree
Showing 98 changed files with 1,449 additions and 1,073 deletions.
4 changes: 4 additions & 0 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ Support is divided into three tiers:

### Supported platforms

The community does not build or test against end of life distributions (EoL).
Thus we do not recommend that you use Node on end of life or unsupported platforms
in production.

| System | Support type | Version | Architectures | Notes |
|--------------|--------------|----------------------------------|----------------------|------------------|
| GNU/Linux | Tier 1 | kernel >= 2.6.32, glibc >= 2.12 | x86, x64, arm, arm64 | |
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ release.
</tr>
<tr>
<td valign="top">
<b><a href="doc/changelogs/CHANGELOG_V8.md#8.1.0">8.1.0</a></b><br/>
<b><a href="doc/changelogs/CHANGELOG_V8.md#8.1.1">8.1.1</a></b><br/>
<a href="doc/changelogs/CHANGELOG_V8.md#8.1.0">8.1.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V8.md#8.0.0">8.0.0</a><br/>
</td>
<td valign="top">
Expand Down
23 changes: 23 additions & 0 deletions benchmark/streams/transform-creation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
'use strict';
var common = require('../common.js');
var Transform = require('stream').Transform;
var inherits = require('util').inherits;

var bench = common.createBenchmark(main, {
n: [1e6]
});

function MyTransform() {
Transform.call(this);
}
inherits(MyTransform, Transform);
MyTransform.prototype._transform = function() {};

function main(conf) {
var n = +conf.n;

bench.start();
for (var i = 0; i < n; ++i)
new MyTransform();
bench.end(n);
}
32 changes: 32 additions & 0 deletions benchmark/zlib/creation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
'use strict';
var common = require('../common.js');
var zlib = require('zlib');

var bench = common.createBenchmark(main, {
type: [
'Deflate', 'DeflateRaw', 'Inflate', 'InflateRaw', 'Gzip', 'Gunzip', 'Unzip'
],
options: ['true', 'false'],
n: [5e5]
});

function main(conf) {
var n = +conf.n;
var fn = zlib['create' + conf.type];
if (typeof fn !== 'function')
throw new Error('Invalid zlib type');
var i = 0;

if (conf.options === 'true') {
var opts = {};
bench.start();
for (; i < n; ++i)
fn(opts);
bench.end(n);
} else {
bench.start();
for (; i < n; ++i)
fn();
bench.end(n);
}
}
54 changes: 54 additions & 0 deletions benchmark/zlib/deflate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
'use strict';
var common = require('../common.js');
var zlib = require('zlib');

var bench = common.createBenchmark(main, {
method: ['createDeflate', 'deflate', 'deflateSync'],
inputLen: [1024],
n: [4e5]
});

function main(conf) {
var n = +conf.n;
var method = conf.method;
var chunk = Buffer.alloc(+conf.inputLen, 'a');

var i = 0;
switch (method) {
// Performs `n` writes for a single deflate stream
case 'createDeflate':
var deflater = zlib.createDeflate();
deflater.resume();
deflater.on('finish', () => {
bench.end(n);
});

bench.start();
(function next() {
if (i++ === n)
return deflater.end();
deflater.write(chunk, next);
})();
break;
// Performs `n` single deflate operations
case 'deflate':
var deflate = zlib.deflate;
bench.start();
(function next(err, result) {
if (i++ === n)
return bench.end(n);
deflate(chunk, next);
})();
break;
// Performs `n` single deflateSync operations
case 'deflateSync':
var deflateSync = zlib.deflateSync;
bench.start();
for (; i < n; ++i)
deflateSync(chunk);
bench.end(n);
break;
default:
throw new Error('Unsupported deflate method');
}
}
Loading

0 comments on commit 6d7f46e

Please sign in to comment.