Skip to content

Commit

Permalink
More improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
kriszyp committed Aug 20, 2021
1 parent c0de524 commit 6779e97
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
This is for benchmarking different key-value stores and databases. For the redis benchmarks, a local redis server must be installed. If anyone has any tips for tuning or improving the performance of the dbs in this benchmarks, would be happy to include that for the sake of fair comparison.
This is for benchmarking different key-value stores and databases through their NodeJS interfaces. Not only is the database important, but the implementation of the interface can have a tremendous impact on the overall performance of database/store interaction through NodeJS.

Benchmarking was done on Node 16.6.1, with 3.4Ghz i7-4770 Windows, using JS numbers from 0 < 10000 as keys, retrieving data from the database (random access), and decoding the data into a structured object with 10 properties.

For the redis benchmarks, a local redis server must be installed. If anyone has any tips for tuning or improving the performance of the dbs in this benchmarks, would be happy to include that for the sake of fair comparison.

Benchmarking was done on Node 16.6.1, with 3.4Ghz i7-4770 Windows, using JS numbers from 0 < 10000 as keys, retrieving data from the database (random access), and decoding the data into a structured object with 10 properties.
12 changes: 6 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ var suite = new benchmark.Suite();
var levelup = require('levelup')
var leveldown = require('leveldown')

//var leveldb = levelup(leveldown('./leveldb'))
var leveldb = leveldown('./leveldb')
var leveldb = levelup(leveldown('./leveldb'))
//var leveldb = leveldown('./leveldb')


const redis = require("redis");
Expand All @@ -27,8 +27,8 @@ client.on("error", function(error) {



var sqlite3 = require('sqlite3').verbose();
var db = new sqlite3.Database(':memory:');
var sqlite3 = require('sqlite3');
var db = new sqlite3.Database('');
var putStmt, getStmt, insertStmt


Expand Down Expand Up @@ -260,14 +260,14 @@ cleanup(async function (err) {
throw err;
}
await setup();
/*suite.add('put redis', {
suite.add('put redis', {
defer: true,
fn: setDataRedis
});
suite.add('get redis', {
defer: true,
fn: getDataRedis
});*/
});

suite.add('put level', {
defer: true,
Expand Down

0 comments on commit 6779e97

Please sign in to comment.