Permalink
Browse files

bring node example to be in line with common-node (clear buffer after

creation)
  • Loading branch information...
1 parent fa4848c commit 561551666a51050afc799ba19a54722d9757268b @olegp committed Sep 29, 2011
Showing with 4 additions and 2 deletions.
  1. +1 −1 benchmarks/buffer-alloc/common-node.js
  2. +3 −1 benchmarks/buffer-alloc/node.js
View
2 benchmarks/buffer-alloc/common-node.js
@@ -3,7 +3,7 @@ var ByteArray = require('binary').ByteArray;
exports.app = function(request) {
var n = 1024, b = new ByteArray(n);
for( var i = 1; i < 50; i++)
- b = new ByteArray(n);
+ b = new ByteArray(n, true);
return {
status: 200,
headers: {
View
4 benchmarks/buffer-alloc/node.js
@@ -3,8 +3,10 @@ var Buffer = require('buffer').Buffer;
http.createServer(function(req, res) {
var n = 1024, b = new Buffer(n);
- for( var i = 1; i < 50; i++)
+ for( var i = 1; i < 50; i++) {
b = new Buffer(n);
+ b.fill(0);
+ }
res.writeHead(200, {
"Content-Type": "text/plain"
});

0 comments on commit 5615516

Please sign in to comment.