diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2009-09-28 12:36:36 +0200 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2009-09-28 12:36:36 +0200 |
commit | f6657c3c9dd3e41df7147adc86ebc6469538e1ed (patch) | |
tree | 4dc6e98303c74ae0e6026293318d27471c84fd87 /benchmark | |
parent | 7abad8b7b360bc328243475fa59b899fcb902c60 (diff) | |
download | node-new-f6657c3c9dd3e41df7147adc86ebc6469538e1ed.tar.gz |
Move http library to /http.js
Diffstat (limited to 'benchmark')
-rw-r--r-- | benchmark/http_simple.js | 8 | ||||
-rw-r--r-- | benchmark/process_loop.js | 3 | ||||
-rw-r--r-- | benchmark/run.js | 3 | ||||
-rw-r--r-- | benchmark/static_http_server.js | 7 |
4 files changed, 18 insertions, 3 deletions
diff --git a/benchmark/http_simple.js b/benchmark/http_simple.js index d1801e7fd5..f334c01fd5 100644 --- a/benchmark/http_simple.js +++ b/benchmark/http_simple.js @@ -1,9 +1,15 @@ +libDir = node.path.join(node.path.dirname(__filename), "../lib"); +node.libraryPaths.unshift(libDir); + +include("/utils.js"); +http = require("/http.js"); + fixed = "" for (var i = 0; i < 20*1024; i++) { fixed += "C"; } stored = {}; -node.http.createServer(function (req, res) { +http.createServer(function (req, res) { var commands = req.uri.path.split("/"); var command = commands[1]; var body = ""; diff --git a/benchmark/process_loop.js b/benchmark/process_loop.js index 67b9edd74b..ec971f0959 100644 --- a/benchmark/process_loop.js +++ b/benchmark/process_loop.js @@ -1,3 +1,6 @@ +libDir = node.path.join(node.path.dirname(__filename), "../lib"); +node.libraryPaths.unshift(libDir); +include("/utils.js"); function next (i) { if (i <= 0) return; diff --git a/benchmark/run.js b/benchmark/run.js index a8a4d1715e..d9c2668687 100644 --- a/benchmark/run.js +++ b/benchmark/run.js @@ -1,3 +1,6 @@ +libDir = node.path.join(node.path.dirname(__filename), "../lib"); +node.libraryPaths.unshift(libDir); +include("/utils.js"); var benchmarks = [ "static_http_server.js" , "timers.js" , "process_loop.js" diff --git a/benchmark/static_http_server.js b/benchmark/static_http_server.js index ef465a8462..3ce04997f0 100644 --- a/benchmark/static_http_server.js +++ b/benchmark/static_http_server.js @@ -1,3 +1,6 @@ +libDir = node.path.join(node.path.dirname(__filename), "../lib"); +node.libraryPaths.unshift(libDir); +http = require("/http.js"); var concurrency = 30; var port = 8000; var n = 700; @@ -11,7 +14,7 @@ for (var i = 0; i < bytes; i++) { body += "C"; } -var server = node.http.createServer(function (req, res) { +var server = http.createServer(function (req, res) { res.sendHeader(200, { "Content-Type": "text/plain", "Content-Length": body.length @@ -35,7 +38,7 @@ function responseListener (res) { } for (var i = 0; i < concurrency; i++) { - var client = node.http.createClient(port); + var client = http.createClient(port); client.id = i; client.get("/").finish(responseListener); requests++; |