Skip to content

Commit d582599

Browse files
committed
Upgrade benchmark scripts for new module API
1 parent f230e45 commit d582599

4 files changed

Lines changed: 13 additions & 10 deletions

File tree

benchmark/http_simple.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
libDir = process.path.join(process.path.dirname(__filename), "../lib");
22
require.paths.unshift(libDir);
33

4-
process.mixin(require("/utils.js"));
5-
http = require("/http.js");
4+
process.mixin(require("sys"));
5+
http = require("sys");
66

77
fixed = ""
88
for (var i = 0; i < 20*1024; i++) {

benchmark/process_loop.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
libDir = process.path.join(process.path.dirname(__filename), "../lib");
1+
var path = require("path");
2+
libDir = path.join(path.dirname(__filename), "../lib");
23
require.paths.unshift(libDir);
3-
process.mixin(require("/utils.js"));
4+
process.mixin(require("sys"));
45
function next (i) {
56
if (i <= 0) return;
67

benchmark/run.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
libDir = process.path.join(process.path.dirname(__filename), "../lib");
1+
var path = require("path");
2+
libDir = path.join(path.dirname(__filename), "../lib");
23
require.paths.unshift(libDir);
3-
process.mixin(require("/utils.js"));
4+
process.mixin(require("sys"));
45
var benchmarks = [ "static_http_server.js"
56
, "timers.js"
67
, "process_loop.js"
78
];
89

9-
var benchmark_dir = process.path.dirname(__filename);
10+
var benchmark_dir = path.dirname(__filename);
1011

1112
function exec (script, callback) {
1213
var start = new Date();
13-
var child = process.createChildProcess(process.ARGV[0], [process.path.join(benchmark_dir, script)]);
14+
var child = process.createChildProcess(process.ARGV[0], [path.join(benchmark_dir, script)]);
1415
child.addListener("exit", function (code) {
1516
var elapsed = new Date() - start;
1617
callback(elapsed, code);

benchmark/static_http_server.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
libDir = process.path.join(process.path.dirname(__filename), "../lib");
1+
var path = require("path");
2+
libDir = path.join(path.dirname(__filename), "../lib");
23
require.paths.unshift(libDir);
3-
http = require("/http.js");
4+
http = require("http");
45
var concurrency = 30;
56
var port = 8000;
67
var n = 700;

0 commit comments

Comments
 (0)