Skip to content
This repository was archived by the owner on Sep 23, 2025. It is now read-only.

awana-archive/osm-p2p-db-benchmark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

osm-p2p-db-benchmark

Benchmarking suite for osm-p2p-db.

Breaks down various osm-p2p-db operations by time spent in LevelDB, chunk store, and application logic.

This makes it easy to swap in various Level and chunk-store backends into osm-p2p-db and see what performance differences they make.

Example

var benchmark = require('osm-p2p-db-benchmark')
var level = require('level')
var fdchunk = require('fd-chunk-store')

benchmark(level, fdchunk, function (err, res) {
  console.log(err ? err : res)
})

outputs

[ { name: 'insert',    total: 3556,  app: 2417, level: 1139, chunk: 0 },
  { name: 'index',     total: 3069,  app: 2646, level: 0,    chunk: 423 },
  { name: 'query',     total: 1911,  app: 1325, level: 586,  chunk: 0 },
  { name: 'replicate', total: 8013,  app: 1679, level: 6049, chunk: 285 },
  { name: 'total',     total: 16549, app: 8067, level: 7774, chunk: 708 } ]

API

var benchmark = require('osm-p2p-db-benchmark')

benchmark.random(level, chunk[, opts], cb)

Generate a random dataset (uniform distribution of N nodes) and run the benchmarking suite with the Level backend level and abstract chunk store chunk. cb is called with (err, res), where res are the timing results shown in the above example output.

Valid opts include:

  • n (Number): the number of nodes to insert to benchmark against

benchmark.db(dbPath, cb)

Use an exising osm-p2p database (directory with log, index, kdb), and run benchmarks against it. cb is called with (err, res), where res are the timing results shown in the above example output.

License

ISC

About

Benchmarking suite for osm-p2p-db.

Resources

Stars

Watchers

Forks

Packages

No packages published