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

Commit

Permalink
Merge remote-tracking branch 'nodejs/master' into chnext
Browse files Browse the repository at this point in the history
  • Loading branch information
kunalspathak committed Feb 4, 2016
2 parents 668b620 + 7406cd3 commit 53bfef3
Show file tree
Hide file tree
Showing 2,365 changed files with 87,449 additions and 48,896 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ test/fixtures
test/**/node_modules
test/disabled
test/tmp*/
tools/doc/node_modules
4 changes: 4 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ rules:
# list: https://github.com/eslint/eslint/tree/master/docs/rules#best-practices
## require falls through comment on switch-case
no-fallthrough: 2
## disallow declaring the same variable more than once
no-redeclare: 2

# Stylistic Issues
# list: https://github.com/eslint/eslint/tree/master/docs/rules#stylistic-issues
Expand Down Expand Up @@ -81,6 +83,8 @@ rules:
space-after-keywords: 2
## no leading/trailing spaces in parens
space-in-parens: [2, "never"]
## no spaces with non-word unary operators, require for word unary operators
space-unary-ops: 2

# ECMAScript 6
# list: http://eslint.org/docs/rules/#ecmascript-6
Expand Down
73 changes: 23 additions & 50 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -672,14 +672,32 @@ The externally maintained libraries used by Node.js are:

- npm, located at deps/npm, is licensed as follows:
"""
The npm application
Copyright (c) npm, Inc. and Contributors
All rights reserved.
Licensed on the terms of The Artistic License 2.0

Node package dependencies of the npm application
Copyright (c) their respective copyright owners
Licensed on their respective license terms

The npm public registry at https://registry.npmjs.org
and the npm website at https://www.npmjs.com
Operated by npm, Inc.
Use governed by terms published on https://www.npmjs.com

"Node.js"
Trademark Joyent, Inc., https://joyent.com
Neither npm nor npm, Inc. are affiliated with Joyent, Inc.

npm is released under the Artistic License 2.0, subject to additional terms
that are listed below.
The Node.js application
Project of Node Foundation, https://nodejs.org

The text of the npm License follows and the text of the additional terms
follows the Artistic License 2.0 terms:
The npm Logo
Copyright (c) Mathias Pettersson and Brian Hammond

"Gubblebum Blocky" typeface
Copyright (c) Tjarda Koster, https://jelloween.deviantart.com
Used with permission

--------

Expand Down Expand Up @@ -879,51 +897,6 @@ The externally maintained libraries used by Node.js are:
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

--------

The following additional terms shall apply to use of the npm software, the npm
website, the npm repository and any other services or products offered by npm,
Inc.:

"Node.js" trademark Joyent, Inc. npm is not officially part of the Node.js
project, and is neither owned by nor affiliated with Joyent, Inc.

"npm" and "The npm Registry" are owned by npm, Inc. All rights reserved.

Modules published on the npm registry are not officially endorsed by npm, Inc.
or the Node.js project.

Data published to the npm registry is not part of npm itself, and is the sole
property of the publisher. While every effort is made to ensure accountability,
there is absolutely no guarantee, warrantee, or assertion expressed or implied
as to the quality, fitness for a specific purpose, or lack of malice in any
given npm package. Packages downloaded through the npm registry are
independently licensed and are not covered by this license.

Additional policies relating to, and restrictions on use of, npm products and
services are available on the npm website. All such policies and restrictions,
as updated from time to time, are hereby incorporated into this license
agreement. By using npm, you acknowledge your agreement to all such policies
and restrictions.

If you have a complaint about a package in the public npm registry, and cannot
resolve it with the package owner, please email support@npmjs.com and explain
the situation. See the [npm Dispute Resolution
policy](https://github.com/npm/policies/blob/master/disputes.md) for more
details.

Any data published to The npm Registry (including user account information) may
be removed or modified at the sole discretion of the npm server administrators.

"npm Logo" contributed by Mathias Pettersson and Brian Hammond,
use is subject to https://www.npmjs.com/policies/trademark

"Gubblebum Blocky" font
Copyright (c) by Tjarda Koster, https://jelloween.deviantart.com
included for use in the npm website and documentation,
used with permission.

This program uses several Node modules contained in the node_modules/
subdirectory, according to the terms of their respective licenses.
"""

- GYP, located at tools/gyp, is licensed as follows:
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,10 @@ bench-events: all
bench-util: all
@$(NODE) benchmark/common.js util

bench-all: bench bench-misc bench-array bench-buffer bench-url bench-events
bench-dgram: all
@$(NODE) benchmark/common.js dgram

bench-all: bench bench-misc bench-array bench-buffer bench-url bench-events bench-dgram bench-util

bench: bench-net bench-http bench-fs bench-tls

Expand All @@ -514,7 +517,7 @@ bench-idle:
$(NODE) benchmark/idle_clients.js &

jslint:
$(NODE) tools/eslint/bin/eslint.js src lib test tools/eslint-rules \
$(NODE) tools/eslint/bin/eslint.js lib src test tools/doc tools/eslint-rules \
--rulesdir tools/eslint-rules --quiet

CPPLINT_EXCLUDE ?=
Expand Down
80 changes: 80 additions & 0 deletions benchmark/dgram/array-vs-concat.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
// test UDP send throughput with the multi buffer API against Buffer.concat
'use strict';

const common = require('../common.js');
const PORT = common.PORT;

// `num` is the number of send requests to queue up each time.
// Keep it reasonably high (>10) otherwise you're benchmarking the speed of
// event loop cycles more than anything else.
var bench = common.createBenchmark(main, {
len: [64, 256, 512, 1024],
num: [100],
chunks: [1, 2, 4, 8],
type: ['concat', 'multi'],
dur: [5]
});

var dur;
var len;
var num;
var type;
var chunk;
var chunks;
var encoding;

function main(conf) {
dur = +conf.dur;
len = +conf.len;
num = +conf.num;
type = conf.type;
chunks = +conf.chunks;

chunk = []
for (var i = 0; i < chunks; i++) {
chunk.push(new Buffer(Math.round(len / chunks)));
}

server();
}

var dgram = require('dgram');

function server() {
var sent = 0;
var received = 0;
var socket = dgram.createSocket('udp4');

var onsend = type === 'concat' ? onsendConcat : onsendMulti;

function onsendConcat() {
if (sent++ % num == 0)
for (var i = 0; i < num; i++) {
socket.send(Buffer.concat(chunk), PORT, '127.0.0.1', onsend);
}
}

function onsendMulti() {
if (sent++ % num == 0)
for (var i = 0; i < num; i++) {
socket.send(chunk, PORT, '127.0.0.1', onsend);
}
}

socket.on('listening', function() {
bench.start();
onsend();

setTimeout(function() {
var bytes = sent * len;
var gbits = (bytes * 8) / (1024 * 1024 * 1024);
bench.end(gbits);
}, dur * 1000);
});

socket.on('message', function(buf, rinfo) {
received++;
});

socket.bind(PORT);
}
70 changes: 70 additions & 0 deletions benchmark/dgram/multi-buffer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// test UDP send/recv throughput with the multi buffer API
'use strict';

const common = require('../common.js');
const PORT = common.PORT;

// `num` is the number of send requests to queue up each time.
// Keep it reasonably high (>10) otherwise you're benchmarking the speed of
// event loop cycles more than anything else.
var bench = common.createBenchmark(main, {
len: [64, 256, 1024],
num: [100],
chunks: [1, 2, 4, 8],
type: ['send', 'recv'],
dur: [5]
});

var dur;
var len;
var num;
var type;
var chunk;
var chunks;
var encoding;

function main(conf) {
dur = +conf.dur;
len = +conf.len;
num = +conf.num;
type = conf.type;
chunks = +conf.chunks;

chunk = []
for (var i = 0; i < chunks; i++) {
chunk.push(new Buffer(Math.round(len / chunks)));
}

server();
}

var dgram = require('dgram');

function server() {
var sent = 0;
var received = 0;
var socket = dgram.createSocket('udp4');

function onsend() {
if (sent++ % num == 0)
for (var i = 0; i < num; i++)
socket.send(chunk, PORT, '127.0.0.1', onsend);
}

socket.on('listening', function() {
bench.start();
onsend();

setTimeout(function() {
var bytes = (type === 'send' ? sent : received) * len;
var gbits = (bytes * 8) / (1024 * 1024 * 1024);
bench.end(gbits);
}, dur * 1000);
});

socket.on('message', function(buf, rinfo) {
received++;
});

socket.bind(PORT);
}
62 changes: 62 additions & 0 deletions benchmark/dgram/offset-length.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// test UDP send/recv throughput with the "old" offset/length API
'use strict';

const common = require('../common.js');
const PORT = common.PORT;

// `num` is the number of send requests to queue up each time.
// Keep it reasonably high (>10) otherwise you're benchmarking the speed of
// event loop cycles more than anything else.
var bench = common.createBenchmark(main, {
len: [1, 64, 256, 1024],
num: [100],
type: ['send', 'recv'],
dur: [5]
});

var dur;
var len;
var num;
var type;
var chunk;
var encoding;

function main(conf) {
dur = +conf.dur;
len = +conf.len;
num = +conf.num;
type = conf.type;
chunk = new Buffer(len);
server();
}

var dgram = require('dgram');

function server() {
var sent = 0;
var received = 0;
var socket = dgram.createSocket('udp4');

function onsend() {
if (sent++ % num == 0)
for (var i = 0; i < num; i++)
socket.send(chunk, 0, chunk.length, PORT, '127.0.0.1', onsend);
}

socket.on('listening', function() {
bench.start();
onsend();

setTimeout(function() {
var bytes = (type === 'send' ? sent : received) * chunk.length;
var gbits = (bytes * 8) / (1024 * 1024 * 1024);
bench.end(gbits);
}, dur * 1000);
});

socket.on('message', function(buf, rinfo) {
received++;
});

socket.bind(PORT);
}
Loading

0 comments on commit 53bfef3

Please sign in to comment.