From 6779e97530ea59e9a445f2405c49bb83d38664a4 Mon Sep 17 00:00:00 2001 From: Kris Zyp Date: Fri, 20 Aug 2021 09:06:24 -0600 Subject: [PATCH] More improvements --- README.md | 7 +++++-- index.js | 12 ++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 04ccfcd..78d88fc 100644 --- a/README.md +++ b/README.md @@ -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. \ No newline at end of file diff --git a/index.js b/index.js index e78c8d7..4b88b7b 100644 --- a/index.js +++ b/index.js @@ -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"); @@ -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 @@ -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,