forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'ry/v0.10' into master
Conflicts: src/node.cc src/node_version.h
- Loading branch information
Showing
160 changed files
with
1,264 additions
and
457 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,7 +124,7 @@ Sam Stephenson <[email protected]> | |
Jorge Chamorro Bieling <[email protected]> | ||
Evan Larkin <evan.larkin.il.com> | ||
Sean Coates <[email protected]> | ||
Tom Hughes <[email protected]> | ||
Tom Hughes-Croucher <[email protected]> | ||
Joshua Peek <[email protected]> | ||
Nathan Rajlich <[email protected]> | ||
Peteris Krumins <[email protected]> | ||
|
@@ -415,7 +415,6 @@ Andy Burke <[email protected]> | |
Sugendran Ganess <[email protected]> | ||
Jim Schubert <[email protected]> | ||
Victor Costan <[email protected]> | ||
Timothy J Fontaine <[email protected]> | ||
Arianit Uka <[email protected]> | ||
Andrei Sedoi <[email protected]> | ||
Eugene Girshov <[email protected]> | ||
|
@@ -428,3 +427,5 @@ Paolo Fragomeni <[email protected]> | |
Scott Blomquist <[email protected]> | ||
Henry Chin <[email protected]> | ||
Julian Gruber <[email protected]> | ||
JeongHoon Byun <[email protected]> | ||
Iskren Ivov Chernev <[email protected]> |
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,59 @@ | ||
// When calling .end(buffer) right away, this triggers a "hot path" | ||
// optimization in http.js, to avoid an extra write call. | ||
// | ||
// However, the overhead of copying a large buffer is higher than | ||
// the overhead of an extra write() call, so the hot path was not | ||
// always as hot as it could be. | ||
// | ||
// Verify that our assumptions are valid. | ||
|
||
var common = require('../common.js'); | ||
var PORT = common.PORT; | ||
|
||
var bench = common.createBenchmark(main, { | ||
type: ['asc', 'utf', 'buf'], | ||
kb: [64, 128, 256, 1024], | ||
c: [100], | ||
method: ['write', 'end '] // two spaces added to line up each row | ||
}); | ||
|
||
function main(conf) { | ||
http = require('http'); | ||
var chunk; | ||
var len = conf.kb * 1024; | ||
switch (conf.type) { | ||
case 'buf': | ||
chunk = new Buffer(len); | ||
chunk.fill('x'); | ||
break; | ||
case 'utf': | ||
encoding = 'utf8'; | ||
chunk = new Array(len / 2 + 1).join('ü'); | ||
break; | ||
case 'asc': | ||
chunk = new Array(len + 1).join('a'); | ||
break; | ||
} | ||
|
||
function write(res) { | ||
res.write(chunk); | ||
res.end(); | ||
} | ||
|
||
function end(res) { | ||
res.end(chunk); | ||
} | ||
|
||
var method = conf.method === 'write' ? write : end; | ||
var args = ['-r', 5000, '-t', 8, '-c', conf.c]; | ||
|
||
var server = http.createServer(function(req, res) { | ||
method(res); | ||
}); | ||
|
||
server.listen(common.PORT, function() { | ||
bench.http('/', args, function() { | ||
server.close(); | ||
}); | ||
}); | ||
} |
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,61 @@ | ||
// test UDP send/recv throughput | ||
|
||
var common = require('../common.js'); | ||
var 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); | ||
} |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
*.swp | ||
.*.swp | ||
npm-debug.log | ||
/test/bin | ||
/test/output.log | ||
|
@@ -20,3 +21,5 @@ html/*.png | |
!.npmignore | ||
|
||
/npm-*.tgz | ||
|
||
*.pyc |
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 |
---|---|---|
|
@@ -19,7 +19,7 @@ <h2 id="DESCRIPTION">DESCRIPTION</h2> | |
<p>This function should not be used programmatically. Instead, just refer | ||
to the <code>npm.bin</code> member.</p> | ||
</div> | ||
<p id="footer">bin — [email protected].14</p> | ||
<p id="footer">bin — [email protected].15</p> | ||
<script> | ||
;(function () { | ||
var wrapper = document.getElementById("wrapper") | ||
|
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 |
---|---|---|
|
@@ -25,7 +25,7 @@ <h2 id="DESCRIPTION">DESCRIPTION</h2> | |
<p>This command will launch a browser, so this command may not be the most | ||
friendly for programmatic use.</p> | ||
</div> | ||
<p id="footer">bugs — [email protected].14</p> | ||
<p id="footer">bugs — [email protected].15</p> | ||
<script> | ||
;(function () { | ||
var wrapper = document.getElementById("wrapper") | ||
|
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,7 +28,7 @@ <h2 id="SEE-ALSO">SEE ALSO</h2> | |
|
||
<ul><li><a href="../doc/index.html">index(1)</a></li></ul> | ||
</div> | ||
<p id="footer">commands — [email protected].14</p> | ||
<p id="footer">commands — [email protected].15</p> | ||
<script> | ||
;(function () { | ||
var wrapper = document.getElementById("wrapper") | ||
|
Oops, something went wrong.