mirror of
https://github.com/nodejs/node.git
synced 2024-11-29 07:00:59 +01:00
Upgrade benchmark scripts for new module API
This commit is contained in:
parent
f230e45183
commit
d582599c14
@ -1,8 +1,8 @@
|
||||
libDir = process.path.join(process.path.dirname(__filename), "../lib");
|
||||
require.paths.unshift(libDir);
|
||||
|
||||
process.mixin(require("/utils.js"));
|
||||
http = require("/http.js");
|
||||
process.mixin(require("sys"));
|
||||
http = require("sys");
|
||||
|
||||
fixed = ""
|
||||
for (var i = 0; i < 20*1024; i++) {
|
||||
|
@ -1,6 +1,7 @@
|
||||
libDir = process.path.join(process.path.dirname(__filename), "../lib");
|
||||
var path = require("path");
|
||||
libDir = path.join(path.dirname(__filename), "../lib");
|
||||
require.paths.unshift(libDir);
|
||||
process.mixin(require("/utils.js"));
|
||||
process.mixin(require("sys"));
|
||||
function next (i) {
|
||||
if (i <= 0) return;
|
||||
|
||||
|
@ -1,16 +1,17 @@
|
||||
libDir = process.path.join(process.path.dirname(__filename), "../lib");
|
||||
var path = require("path");
|
||||
libDir = path.join(path.dirname(__filename), "../lib");
|
||||
require.paths.unshift(libDir);
|
||||
process.mixin(require("/utils.js"));
|
||||
process.mixin(require("sys"));
|
||||
var benchmarks = [ "static_http_server.js"
|
||||
, "timers.js"
|
||||
, "process_loop.js"
|
||||
];
|
||||
|
||||
var benchmark_dir = process.path.dirname(__filename);
|
||||
var benchmark_dir = path.dirname(__filename);
|
||||
|
||||
function exec (script, callback) {
|
||||
var start = new Date();
|
||||
var child = process.createChildProcess(process.ARGV[0], [process.path.join(benchmark_dir, script)]);
|
||||
var child = process.createChildProcess(process.ARGV[0], [path.join(benchmark_dir, script)]);
|
||||
child.addListener("exit", function (code) {
|
||||
var elapsed = new Date() - start;
|
||||
callback(elapsed, code);
|
||||
|
@ -1,6 +1,7 @@
|
||||
libDir = process.path.join(process.path.dirname(__filename), "../lib");
|
||||
var path = require("path");
|
||||
libDir = path.join(path.dirname(__filename), "../lib");
|
||||
require.paths.unshift(libDir);
|
||||
http = require("/http.js");
|
||||
http = require("http");
|
||||
var concurrency = 30;
|
||||
var port = 8000;
|
||||
var n = 700;
|
||||
|
Loading…
Reference in New Issue
Block a user