#Performance
See test/benchmark/compare.js for benchmark code.
Executed on cpu: 2.66 Ghz Intel Core i7
and node: v0.6.21-pre
.
Case | ms / run - less is better |
---|---|
a small document (693 B) |
var fs = require('fs'); | |
var url = require('url'); | |
var path = require('path'); | |
var http = require('http'); | |
var mime = require('mime'); | |
var zlib = require('zlib'); | |
// Define compression types | |
var compressors = { | |
gzip: zlib.createGzip, |
var domain = require('domain'); | |
var url = require('url'); | |
var util = require('util'); | |
var events = require('events'); | |
/* hack */ | |
domain.Domain.prototype.run = function (fn) { | |
var active = this; | |
// sync thrown errors needs be be catch and deleayed by process.nextTick. |
Andreass-MacBook-Pro:~ Andreas$ curl -v http://google.dk | |
* About to connect() to google.dk port 80 (#0) | |
* Trying 173.194.69.94... connected | |
* Connected to google.dk (173.194.69.94) port 80 (#0) | |
> GET / HTTP/1.1 | |
> User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5 | |
> Host: google.dk | |
> Accept: */* | |
> | |
< HTTP/1.1 301 Moved Permanently |
#Performance
See test/benchmark/compare.js for benchmark code.
Executed on cpu: 2.66 Ghz Intel Core i7
and node: v0.6.21-pre
.
Case | ms / run - less is better |
---|---|
a small document (693 B) |
make apf | |
cd node_modules/packager; node package.js projects/apf_cloud9.apr | |
10:19:43.267 Start parsing main application | |
using file: /Users/Andreas/GitHub/cloud9/node_modules/packager/projects/projects/apf_cloud9.apr | |
path.existsSync is now called `fs.existsSync`. | |
10:19:43.287 Start parsing | |
10:19:43.289 Parsing settings | |
10:19:43.290 Parsing files | |
10:19:43.398 Getting filelist done. | |
10:19:43.398 Parsing defines |
var fs = require('fs'); | |
var util = require('util'); | |
var Stream = require('stream'); | |
var file = fs.createReadStream('file.csv'); | |
var parser = new CSV(); | |
// values will be emitted | |
parser.on('value', function (value) { | |
console.log(value); |
if (process.argv[2] === 'bench') { | |
var pre = process.hrtime(); | |
if (process.argv[3] === '1') { | |
(function () { | |
var args = Array.prototype.slice.call(arguments); | |
})(1, 2.0, "string", {"foo": true}); | |
} | |
else if (process.argv[3] === '2') { |
Andreass-MacBook-Pro:node Andreas$ npm install -g vock@0.1.2 | |
npm http GET https://registry.npmjs.org/vock/0.1.2 | |
npm http 304 https://registry.npmjs.org/vock/0.1.2 | |
npm http GET https://registry.npmjs.org/node-gyp | |
npm http GET https://registry.npmjs.org/msgpack-js | |
npm http GET https://registry.npmjs.org/optimist | |
npm http GET https://registry.npmjs.org/bindings | |
npm http GET https://registry.npmjs.org/colors | |
npm http GET https://registry.npmjs.org/pripub | |
npm http GET https://registry.npmjs.org/prompt |
Error: error in route | |
at /Users/Andreas/Sites/Admazely/director-wrapper/test.js:15:15 | |
at Domain.bind.b (domain.js:201:18) | |
at Domain.run (domain.js:141:23) | |
at Server.<anonymous> (/Users/Andreas/Sites/Admazely/director-wrapper/test.js:10:7) | |
at Server.EventEmitter.emit (events.js:91:17) | |
at HTTPParser.parser.onIncoming (http.js:1793:12) | |
at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:111:23) | |
at Socket.socket.ondata (http.js:1690:22) | |
at TCP.onread (net.js:402:27) |
From https://gist.github.com/3050224
From http://blog.smartcore.net.au/smartos-the-basics/