Socket
Socket
Sign inDemoInstall

scattered-store

Package Overview
Dependencies
9
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.4 to 0.1.5

4

benchmark/benchmark.js

@@ -61,3 +61,3 @@ "use strict";

jetpack.dir(path, { exists: false });
jetpack.remove(path);

@@ -177,3 +177,3 @@ console.log('Testing scattered-store performance: ' + itemsTotal +

var clean = function () {
jetpack.dir(path, { exists: false });
jetpack.remove(path);
};

@@ -180,0 +180,0 @@

@@ -125,3 +125,3 @@ "use strict";

var buf = encodeForStorage(key, value);
return storageDir.writeAsync(filePath, buf, { safe: true });
return storageDir.writeAsync(filePath, buf, { atomic: true });
};

@@ -133,3 +133,3 @@ set.asyncInterfaceType = 'promise';

var filePath = transformKeyToFilePath(key);
storageDir.readAsync(filePath, 'buf', { safe: true })
storageDir.readAsync(filePath, 'buf')
.then(function (buf) {

@@ -136,0 +136,0 @@ if (buf) {

@@ -35,3 +35,3 @@ // Parallel transform stream. Gets the path to file and returns

jetpack.readAsync(path, 'buf', { safe: true })
jetpack.readAsync(path, 'buf')
.then(function (buf) {

@@ -38,0 +38,0 @@ that._running -= 1;

{
"name": "scattered-store",
"description": "Key-value store for large datasets",
"version": "0.1.4",
"version": "0.1.5",
"author": "Jakub Szwacz <jakub@szwacz.com>",

@@ -14,3 +14,3 @@ "keywords": [

"dependencies": {
"fs-jetpack": "0.5.2",
"fs-jetpack": "0.6.0",
"q": "1.0.1"

@@ -17,0 +17,0 @@ },

@@ -174,3 +174,3 @@ scattered-store

Testing scattered-store performance: 10000 items, 25KB each, 0.3GB combined.
set 1737 items/s
set 2106 items/s
get 4170 items/s

@@ -182,3 +182,3 @@ getMany 7018 items/s

Testing scattered-store performance: 100000 items, 25KB each, 2.5GB combined.
set 1684 items/s
set 1926 items/s
get 3926 items/s

@@ -190,3 +190,3 @@ getMany 6671 items/s

Testing scattered-store performance: 1000000 items, 25KB each, 25.0GB combined.
set 1132 items/s
set 1255 items/s
get 1259 items/s

@@ -193,0 +193,0 @@ getMany 5139 items/s

@@ -208,5 +208,7 @@ "use strict";

var itemFromStore = stream.read();
var item = _.findWhere(dataset, itemFromStore);
expect(item).toBeDefined();
count += 1;
if (itemFromStore !== null) {
var item = _.findWhere(dataset, itemFromStore);
expect(item).toBeDefined();
count += 1;
}
});

@@ -225,4 +227,7 @@ stream.on('end', function () {

stream.on('readable', function () {
deliveredItem = stream.read();
expect(deliveredItem).toEqual({ key: "nonexistent", value: null });
var data = stream.read();
if (data !== null) {
deliveredItem = data;
expect(deliveredItem).toEqual({ key: "nonexistent", value: null });
}
});

@@ -264,5 +269,7 @@ stream.on('end', function () {

var itemFromStore = stream.read();
var item = _.findWhere(dataset, itemFromStore);
expect(item).toBeDefined();
count += 1;
if (itemFromStore) {
var item = _.findWhere(dataset, itemFromStore);
expect(item).toBeDefined();
count += 1;
}
});

@@ -269,0 +276,0 @@ stream.on('end', function () {

"use strict";
describe('the way data is stored', function () {
describe('persistence', function () {

@@ -39,4 +39,6 @@ var _ = require('underscore');

var itemFromStore = stream.read();
expect(itemFromStore).toEqual({ key: 'abc', value: '123' });
count += 1;
if (itemFromStore !== null) {
expect(itemFromStore).toEqual({ key: 'abc', value: '123' });
count += 1;
}
});

@@ -43,0 +45,0 @@ stream.on('end', function () {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc