Skip to content

Instantly share code, notes, and snippets.

@piscisaureus
Created March 6, 2012 21:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save piscisaureus/1989015 to your computer and use it in GitHub Desktop.
Save piscisaureus/1989015 to your computer and use it in GitHub Desktop.
diff --git a/benchmark/http_simple.js b/benchmark/http_simple.js
index 74ba4d7..48dc5c3 100644
--- a/benchmark/http_simple.js
+++ b/benchmark/http_simple.js
@@ -26,14 +26,10 @@ var server = http.createServer(function (req, res) {
var n = parseInt(arg, 10)
if (n <= 0)
throw "bytes called with n <= 0"
- if (stored[n] === undefined) {
- console.log("create stored[n]");
- stored[n] = "";
- for (var i = 0; i < n; i++) {
- stored[n] += "C"
- }
+ body = "12345678";
+ while (body.length < n) {
+ body += body;
}
- body = stored[n];
} else if (command == "buffer") {
var n = parseInt(arg, 10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment