Commit Graph

8 Commits

Author SHA1 Message Date
Christopher Haster 5d68d7eccd Updated benchmarks after internal API changes 2023-04-16 12:56:37 -05:00
Christopher Haster 27fc481ec2 Generalized btree benchmarks, amortized benchmarks, plot.py/plotmpl.py tweaks
These benchmarks are now more useful for seeing how these B-trees perform.

In plot.py/plotmpl.py:

- Added --legend as another alias for -l, --legend-right.

- Allowed omitting of datasets from the legend by using empty strings
  in --labels.

- Do not sum multiple data points on the same x coordinate. This was a
  bad idea that risks invalid results going unnoticed.

  As a plus multiple data points on the same x coordinate can be abused for
  a cheap representation of measurement error.
2023-03-19 01:21:31 -05:00
Christopher Haster 2b8594528e Added some simple B-tree benchmarks 2023-03-17 14:20:09 -05:00
Christopher Haster 386ef69570 Updated rbyd benchmarks based on grow/shrink changes 2023-03-17 14:20:09 -05:00
Christopher Haster 8c9f5e9afe Brought bench_rbyd up to date with id/tag changes
Here's a quick snapshot of the measured bytes read during
lfsr_rbyd_lookup over number of tags in the rbyd block, showing the
expected O(log n) growth:

.25KiB ^                                 : .      . .. ..  .....
       |                         ::: :: :::::: ::::::: :::::::::
       |           .  . ...::.::::::::::::::::::::::::::::::::::
       |        ::::::::::::::::::::::::::::::::::::::::::::::::
       |   :.::.::::::::::::::::::::::::::::::::::::::::::::::::
       |  ::::::::::::::::::::::::::::::::::::::::::::::::::::::
       |.::::::::::::::::::::::::::::::::::::::::::::::::::::'::
       :::::::::::::::::'':'::' ::':'':'' '' '':'''' ''    '
       ::::::::::::::::'  ' ''  ': '  '        '
       :::: ::  :
       ::'
       :
       :
       :
    0B '------------------------------------------------------->
       0tags                                              4Ktags
2023-02-14 14:59:23 -06:00
Christopher Haster 9a8e1d93c6 Added some rbyd benchmarks, fixed/tweaked some related scripts
- Added both uattr (limited to 256) and id (limited to 65535) benchmarks
  covering the main rbyd operations

- Fixed issue where --defines gets passed to the test/bench runners when
  querying id-specific information. After changing the test/bench
  runners to prioritize explicit defines, this causes problems for
  recorded benchmark results and debug related things.

- In plot.py/plotmpl.py, made --by/-x/-y in subplots behave somewhat
  reasonably, contributing to a global dataset and the figure's legend,
  colors, etc, but only shown in the specified subplot. This is useful
  mainly for showing different -y values on different subplots.

- In plot.py/plotmpl.py, added --labels to allow explicit configuration
  of legend labels, much like --colors/--formats/--chars/etc. This
  removes one of the main annoying needs for modifying benchmark results.
2023-02-12 17:14:42 -06:00
Christopher Haster b0382fa891 Added BENCH/TEST_PRNG, replacing other ad-hoc sources of randomness
When you add a function to every benchmark suite, you know if should
probably be provided by the benchmark runner itself. That being said,
randomness in tests/benchmarks is a bit tricky because it needs to be
strictly controlled and reproducible.

No global state is used, allowing tests/benches to maintain multiple
randomness stream which can be useful for checking results during a run.

There's an argument for having global prng state in that the prng could
be preserved across power-loss, but I have yet to see a use for this,
and it would add a significant requirement to any future test/bench runner.
2022-12-06 23:09:07 -06:00
Christopher Haster 4fe0738ff4 Added bench.py and bench_runner.c for benchmarking
These are really just different flavors of test.py and test_runner.c
without support for power-loss testing, but with support for measuring
the cumulative number of bytes read, programmed, and erased.

Note that the existing define parameterization should work perfectly
fine for running benchmarks across various dimensions:

./scripts/bench.py \
    runners/bench_runner \
    bench_file_read \
    -gnor \
    -DSIZE='range(0,131072,1024)'

Also added a couple basic benchmarks as a starting point.
2022-11-15 13:33:34 -06:00