summaryrefslogtreecommitdiff
path: root/scripts/benchmark/sqlite-blobs-backend/README.rst
blob: 2d7a257fe0fd947c8a17dc88abb39cfbfed29b0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Plotting SQLite Blobs Backend storage/retrieval speed
=====================================================

This script produces a bar graph comparing storage and retrieval times for
different amount/sizes of incoming data (1 x 10M, 10 x 1M, 100 x 100K, 1000
x 10K).

Data acquisition
----------------

Data was gathered through different runs of the code in
`soledad/tests/benchmarks/test_sqlite_blobs_backend.py`. As these tests are run
twice by default, you should remove the second call to pytest in `tox.ini` that
would cause a second run of the tests for measuring memory. This script only
plots time, for now.

Once you done the above, chdir into `soledad/tests` and do something like this:

  tox -e benchmarks -- -m sqlite_blobs_backend_get --benchmark-autosave
  tox -e benchmarks -- -m sqlite_blobs_backend_put --benchmark-autosave

Each run of tox as above produces a JSON file in `soledad/tests/.benchmarks`
with stats. Copy the first file into `data/get.json` and the second file into
`data/put.json` (where `data/` is a subdir in the same directory of this readme
file).

Plotting
--------

Once you have all your data in subdirectories of the `data/` directory and the
script is correctly tuned for your data, running `make` should be enough to
create a virtualenvironment with dependencies and plotting data.

By default, the script will generate a file called `./sqlite-blobs-backend.png`
in the current directory with the plot of the data.