Skip to content

Commit

Permalink
Release 0.1.0beta6
Browse files Browse the repository at this point in the history
  • Loading branch information
pgte committed Jan 10, 2011
1 parent 5610f8c commit 8b0e123
Show file tree
Hide file tree
Showing 13 changed files with 9 additions and 26 deletions.
Empty file removed README
Empty file.
2 changes: 0 additions & 2 deletions benchmarks/benchmark_cached_key_map_random.js
Expand Up @@ -24,7 +24,6 @@ module.exports.run = function(benchmark, next) {

benchmark.end();

var map = {};
var keys = [];
var key_count = 0;

Expand All @@ -41,7 +40,6 @@ module.exports.run = function(benchmark, next) {
var value = random.createRandomObject();
var key = random.createRandomString(16);
keys.push(key);
map[key] = value;
key_map.put(key, value, function(err) {
if (err) {
throw err;
Expand Down
2 changes: 0 additions & 2 deletions benchmarks/benchmark_cached_ordered_index.js
Expand Up @@ -26,7 +26,6 @@ module.exports.run = function(benchmark, next) {
};
};

var map = {};
var key_count = 0;

benchmark.start('clearing key map');
Expand All @@ -46,7 +45,6 @@ module.exports.run = function(benchmark, next) {
var value_index = i % 3;
var value = createRandomObject(a_values[value_index], b_values[value_index]);
var key = random.createRandomString(16);
map[key] = value;
key_map.put(key, value, function(err) {
if (err) {
throw err;
Expand Down
2 changes: 0 additions & 2 deletions benchmarks/benchmark_cached_unordered_index.js
Expand Up @@ -26,7 +26,6 @@ module.exports.run = function(benchmark, next) {
};
};

var map = {};
var key_count = 0;

benchmark.start('clearing key map');
Expand All @@ -46,7 +45,6 @@ module.exports.run = function(benchmark, next) {
var value_index = i % 3;
var value = createRandomObject(a_values[value_index], b_values[value_index]);
var key = random.createRandomString(16);
map[key] = value;
key_map.put(key, value, function(err) {
if (err) {
throw err;
Expand Down
3 changes: 1 addition & 2 deletions benchmarks/benchmark_collection.js
Expand Up @@ -10,7 +10,6 @@ module.exports.run = function(benchmark, next) {
}

benchmark.end();
var assert = require('assert');

benchmark.start('prunning collection');
collection.clear(function(err) {
Expand All @@ -34,7 +33,7 @@ module.exports.run = function(benchmark, next) {
var index = 0;
benchmark.start('reading entire collection of ' + OBJECT_COUNT + ' records');
collection.read(function(error, record) {
assert.equal(error, null);
if (error) { throw error; }
if (record === null) {
benchmark.end();
collection.end(function(err) {
Expand Down
1 change: 0 additions & 1 deletion benchmarks/benchmark_collection_filter.js
@@ -1,7 +1,6 @@
module.exports.run = function(benchmark, next) {

var random = require('../tools/random_generator');
var assert = require('assert');

require(__dirname + '/../lib/alfred/collection.js').open(__dirname + '/../tmp/collection_filter_benchmark.alf', function(err, collection) {
if (err) {
Expand Down
8 changes: 2 additions & 6 deletions benchmarks/benchmark_indexed_key_map.js
@@ -1,6 +1,5 @@
module.exports.run = function(benchmark, next) {

var assert = require('assert');
var sys = require('sys') || require('util');
var fs = require('fs');
var random = require('../tools/random_generator');
Expand All @@ -24,7 +23,6 @@ module.exports.run = function(benchmark, next) {

benchmark.end();

var map = {};
var keys = [];
var key_count = 0;

Expand All @@ -41,7 +39,6 @@ module.exports.run = function(benchmark, next) {
var value = random.createRandomObject();
var key = random.createRandomString(16);
keys.push(key);
map[key] = value;
key_map.put(key, value, function(err) {
if (err) {
throw err;
Expand All @@ -66,7 +63,7 @@ module.exports.run = function(benchmark, next) {
benchmark.end();

var timeout = setTimeout(function() {
assert.ok(false, "timeout");
throw new Error('timeout');
}, 240000);

var tested_keys = 0;
Expand All @@ -80,9 +77,8 @@ module.exports.run = function(benchmark, next) {
for (var i = 0; i < OBJECT_COUNT; i++) {
(function(i) {
var key = keys[i];
var value = map[key];
key_map.get(key, function(err, record) {
assert.deepEqual(record, value);
if (err) { throw err; }
});
tested_keys ++;
if (tested_keys == going_for) {
Expand Down
2 changes: 0 additions & 2 deletions benchmarks/benchmark_indexed_key_map_random.js
Expand Up @@ -24,7 +24,6 @@ module.exports.run = function(benchmark, next) {

benchmark.end();

var map = {};
var keys = [];
var key_count = 0;

Expand All @@ -41,7 +40,6 @@ module.exports.run = function(benchmark, next) {
var value = random.createRandomObject();
var key = random.createRandomString(16);
keys.push(key);
map[key] = value;
key_map.put(key, value, function(err) {
if (err) {
throw err;
Expand Down
2 changes: 0 additions & 2 deletions benchmarks/benchmark_key_map.js
Expand Up @@ -12,7 +12,6 @@ module.exports.run = function(benchmark, next) {
var RETRIEVE_RANDOM_COUNT = 10; //0;

var keys = [];
var map = {};

key_map.clear(function(err) {
if (err) {
Expand All @@ -25,7 +24,6 @@ module.exports.run = function(benchmark, next) {
var value = random.createRandomObject();
var key = random.createRandomString(16);
keys.push(key);
map[key] = value;
key_map.put(key, value, function(err) {
if (err) {
throw err;
Expand Down
2 changes: 0 additions & 2 deletions benchmarks/benchmark_key_map_each_with_pos.js
Expand Up @@ -12,7 +12,6 @@ module.exports.run = function(benchmark, next) {
throw err;
}

var map = {};
var key_count = 0;

key_map.clear(function(err) {
Expand All @@ -23,7 +22,6 @@ module.exports.run = function(benchmark, next) {
(function(i) {
var value = random.createRandomObject();
var key = random.createRandomString(16);
map[key] = value;
key_map.put(key, value, function(err) {
if (err) {
throw err;
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/results/summaries/latest
5 changes: 3 additions & 2 deletions lib/alfred/files/file.js
Expand Up @@ -206,7 +206,7 @@ File.prototype.readOne = function(position, callback) {

this.queue_size ++;

var buf = new Buffer(this.options.buffer_length),
var buf = new Buffer(14),
read_string = new Buffer(this.options.buffer_length);
bytesRead = 0,
self = this,
Expand Down Expand Up @@ -245,11 +245,12 @@ File.prototype.readOne = function(position, callback) {
}

if (!processed_header) {
// now length is the record length + 40 * 2 (header is 12 bytes and trailer is 40 bytes)
// now length is the record length + 54 (header is 12 bytes and trailer is 40 bytes)
length = parseInt(read_string.toString('utf8', 2, 14), 10) + 54;
var new_buf = new Buffer(length);
read_string.copy(new_buf, 0, 0, bytesRead);
read_string = new_buf;
buf = new Buffer(length);
processed_header = true;
}
if (bytesRead >= length) {
Expand Down
4 changes: 2 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{ "name" : "alfred"
, "description" : "In-process key-value store"
, "version" : "0.1.0beta5"
, "version" : "0.1.0beta6"
, "homepage" : "http://pgte.github.com/alfred"
, "author" : "Pedro Teixeira <pedro.teixeira@gmail.com> (http://metaduck.com)"
, "contributors" :
Expand All @@ -20,7 +20,7 @@
, "dependencies" :
{
"step" : ">=0.0.3"
, "carrier" : ">= 0.0.4"
, "carrier" : ">= 0.1.0"
, "crc" : ">= 0.1.0"
}
, "licenses" :
Expand Down

0 comments on commit 8b0e123

Please sign in to comment.