Skip to content

Conversation

@daniel-sanche
Copy link
Contributor

WIP, blocked on #747

This PR adds simple benchmark tests. The main goal currently is for performance profiling, to detect bottlenecks during development. In the future, we can extend this system to get more objective performance metrics, and to
run cross-language benchmarks, to test functionality against existing clients.


Implementation

Benchmarks are implemented in tests/benchmarks/benchmarks.py, which define client and server logic to test as part of the benchmark.

tests/benchmarks/test_benchmarks.py is a pytest file that will drive the benchmarks on both the v3 client and the v3 client, and report timing results.

Running python -m pytest test_benchmarks.py --profile will include a profile trace for each failed benchmark, which can be read through the CLI or visualized in snakeviz to find bottlenecks in the code. We can use this to optimize our code.


Initial Benchmark results:

╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────── Timed Benchmark Results ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ SimpleReads - test max throughput                                                                                                                                                                                                                          │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Baseline: 0.42s
New: 0.88s
Change: 211.21%
F
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────── Timed Benchmark Results ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ SimpleReads - test throughput with server delays                                                                                                                                                                                                           │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Baseline: 1.04s
New: 1.03s
Change: 99.65%
.
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────── Timed Benchmark Results ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ComplexReads - test with more heterogeneous data                                                                                                                                                                                                            │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Baseline: 2.86s
New: 1.78s
Change: 62.18%
.
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────── Timed Benchmark Results ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ComplexReads - test complex payloads with server delay                                                                                                                                                                                                     │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Baseline: 2.19s
New: 2.23s
Change: 101.94%
F

The v3 update is faster in some benchmarks, but slower in others. A quick look at the profile shows some obvious optimizations that can be made that should change these numbers very quickly though

@product-auto-label product-auto-label bot added size: xl Pull request size is extra large. api: bigtable Issues related to the googleapis/python-bigtable API. labels May 12, 2023
@daniel-sanche
Copy link
Contributor Author

closed in favor of #840

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigtable Issues related to the googleapis/python-bigtable API. size: xl Pull request size is extra large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant