diff options
author | Trevor Norris <trev.norris@gmail.com> | 2013-07-08 16:53:41 -0700 |
---|---|---|
committer | Trevor Norris <trev.norris@gmail.com> | 2013-07-08 16:53:41 -0700 |
commit | 22668db73d1accf1e9332b6b780b84a144277888 (patch) | |
tree | f049a3fb33db26e76318974935cda46d395b2b7e /benchmark/net | |
parent | ead8e26b5bcafdbb978fcfc36853d4f88a9848b5 (diff) | |
download | node-new-22668db73d1accf1e9332b6b780b84a144277888.tar.gz |
benchmark: update callbacks only receive data
Since the SlabAllocator was removed the buffer length/offset is no
longer sent to the onread callback. The benchmarks have been updated to
reflect that.
Diffstat (limited to 'benchmark/net')
-rw-r--r-- | benchmark/net/tcp-raw-c2s.js | 5 | ||||
-rw-r--r-- | benchmark/net/tcp-raw-pipe.js | 9 | ||||
-rw-r--r-- | benchmark/net/tcp-raw-s2c.js | 5 |
3 files changed, 8 insertions, 11 deletions
diff --git a/benchmark/net/tcp-raw-c2s.js b/benchmark/net/tcp-raw-c2s.js index e5b3662a8b..e3c726e452 100644 --- a/benchmark/net/tcp-raw-c2s.js +++ b/benchmark/net/tcp-raw-c2s.js @@ -57,7 +57,7 @@ function server() { bench.end((bytes * 8) / (1024 * 1024 * 1024)); }, dur * 1000); - clientHandle.onread = function(buffer, offset, length) { + clientHandle.onread = function(buffer) { // we're not expecting to ever get an EOF from the client. // just lots of data forever. if (!buffer) @@ -65,8 +65,7 @@ function server() { // don't slice the buffer. the point of this is to isolate, not // simulate real traffic. - // var chunk = buffer.slice(offset, offset + length); - bytes += length; + bytes += buffer.length; }; clientHandle.readStart(); diff --git a/benchmark/net/tcp-raw-pipe.js b/benchmark/net/tcp-raw-pipe.js index 4e53c1f0ca..affbae37a0 100644 --- a/benchmark/net/tcp-raw-pipe.js +++ b/benchmark/net/tcp-raw-pipe.js @@ -48,14 +48,13 @@ function server() { if (!clientHandle) fail('connect'); - clientHandle.onread = function(buffer, offset, length) { + clientHandle.onread = function(buffer) { // we're not expecting to ever get an EOF from the client. // just lots of data forever. if (!buffer) fail('read'); - var chunk = buffer.slice(offset, offset + length); - var writeReq = clientHandle.writeBuffer(chunk); + var writeReq = clientHandle.writeBuffer(buffer); if (!writeReq) fail('write'); @@ -99,11 +98,11 @@ function client() { clientHandle.readStart(); - clientHandle.onread = function(buffer, start, length) { + clientHandle.onread = function(buffer) { if (!buffer) fail('read'); - bytes += length; + bytes += buffer.length; }; connectReq.oncomplete = function() { diff --git a/benchmark/net/tcp-raw-s2c.js b/benchmark/net/tcp-raw-s2c.js index 93a917e06f..9d3e579450 100644 --- a/benchmark/net/tcp-raw-s2c.js +++ b/benchmark/net/tcp-raw-s2c.js @@ -111,7 +111,7 @@ function client() { connectReq.oncomplete = function() { var bytes = 0; - clientHandle.onread = function(buffer, offset, length) { + clientHandle.onread = function(buffer) { // we're not expecting to ever get an EOF from the client. // just lots of data forever. if (!buffer) @@ -119,8 +119,7 @@ function client() { // don't slice the buffer. the point of this is to isolate, not // simulate real traffic. - // var chunk = buffer.slice(offset, offset + length); - bytes += length; + bytes += buffer.length; }; clientHandle.readStart(); |