bench: Remove unused 'fast_buffer2' benchmarks
authorisaacs <i@izs.me>
Mon, 11 Feb 2013 22:12:35 +0000 (14:12 -0800)
committerisaacs <i@izs.me>
Tue, 19 Feb 2013 22:14:33 +0000 (14:14 -0800)
benchmark/fast_buffer2.js [deleted file]
benchmark/fast_buffer2_creation.js [deleted file]

diff --git a/benchmark/fast_buffer2.js b/benchmark/fast_buffer2.js
deleted file mode 100644 (file)
index 861ae3b..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-var SlowBuffer = require('buffer').SlowBuffer;
-var POOLSIZE = 8*1024;
-var pool;
-
-function allocPool () {
-  pool = new SlowBuffer(POOLSIZE);
-  pool.used = 0;
-}
-
-function FastBuffer (length) {
-  this.length = length;
-
-  if (length > POOLSIZE) {
-    // Big buffer, just alloc one.
-    this.parent = new Buffer(length);
-    this.offset = 0;
-  } else {
-    // Small buffer.
-    if (!pool || pool.length - pool.used < length) allocPool();
-    this.parent = pool;
-    this.offset = pool.used;
-    pool.used += length;
-  }
-
-  // HERE HERE HERE
-  SlowBuffer.makeFastBuffer(this.parent, this, this.offset, this.length);
-}
-
-exports.FastBuffer = FastBuffer;
-
-FastBuffer.prototype.get = function (i) {
-  if (i < 0 || i >= this.length) throw new Error("oob");
-  return this.parent[this.offset + i];
-};
-
-FastBuffer.prototype.set = function (i, v) {
-  if (i < 0 || i >= this.length) throw new Error("oob");
-  return this.parent[this.offset + i] = v;
-};
-
-// TODO define slice, toString, write, etc.
-// slice should not use c++
diff --git a/benchmark/fast_buffer2_creation.js b/benchmark/fast_buffer2_creation.js
deleted file mode 100644 (file)
index 877f569..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-
-FastBuffer = require('./fast_buffer2').FastBuffer;
-for (var i = 0; i < 1e6; i++) {
-  b = new FastBuffer(10);
-  b[1] = 2;
-}