Skip to content

Instantly share code, notes, and snippets.

@winstonleedev
Last active July 17, 2020 00:19
Show Gist options
  • Save winstonleedev/cec2e31e4e8ccc8f0624888d1ad2317a to your computer and use it in GitHub Desktop.
Save winstonleedev/cec2e31e4e8ccc8f0624888d1ad2317a to your computer and use it in GitHub Desktop.
Benchmark to extract keys and value from level db, and read them again from the new database
#!/bin/bash
# Create smaller DB from big DB
sudo lev ~/caliper-scripts/generated/production/ledgersData/chains/index --all --limit 1000000 > ~/benchdb.export
sudo lev ~/benchdb --batch ~/benchdb.export
# Bench querying the big DB
{ time { sudo lev ~/caliper-scripts/generated/production/ledgersData/chains/index --keys > /dev/null; } } 2> ~/bigQuery.txt
# Bench querying the small DB
{ time { sudo lev ~/benchdb --keys > /dev/null; } } 2> ~/smallQuery.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment