Skip to content

[DO NOT MERGE] bench: add ingest benchmark for execute_concurrent - #832

Draft
mykaul wants to merge 1 commit into
scylladb:masterfrom
mykaul:bench/ingest-benchmark
Draft

[DO NOT MERGE] bench: add ingest benchmark for execute_concurrent#832
mykaul wants to merge 1 commit into
scylladb:masterfrom
mykaul:bench/ingest-benchmark

Conversation

@mykaul

@mykaul mykaul commented Apr 23, 2026

Copy link
Copy Markdown

Summary

  • Adds bench/bench_ingest.py and bench/run_bench.sh for benchmarking execute_concurrent ingestion throughput
  • Warmup phase, multiple timed runs with best/avg/worst reporting
  • Pre-loads data before timing to isolate ingestion performance
  • Supports multiple variants (stock, numpy, decoupled) across separate venvs

Split out from #827 to keep that PR focused on the concurrent submitter feature itself.

@mykaul mykaul changed the title bench: add ingest benchmark for execute_concurrent [DO NOT MERGE] bench: add ingest benchmark for execute_concurrent Apr 24, 2026
@mykaul
mykaul marked this pull request as draft April 24, 2026 09:42
- bench_ingest.py: benchmark for execute_concurrent ingestion throughput
- run_bench.sh: harness to run across multiple venvs and compare results
- Warmup phase, multiple timed runs with best/avg/worst reporting
- Pre-loads data before timing to separate data prep from ingestion
- Variants for stock master, numpy, and decoupled executor
Copilot AI review requested due to automatic review settings July 29, 2026 17:32
@mykaul
mykaul force-pushed the bench/ingest-benchmark branch from 85e8795 to fc19643 Compare July 29, 2026 17:32
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7e185182-9db7-4b3c-8122-9b5618806d85

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a benchmark harness for comparing vector ingestion throughput across execute_concurrent, decoupled, NumPy, free-threaded, and Rust-backed driver variants.

Changes:

  • Adds dataset loading, schema setup, warmup, timed runs, and JSON throughput reporting.
  • Adds a shell runner for variant-specific environments, CPU pinning, and comparison summaries.
  • Introduces benchmark variants intended to evaluate the concurrent submitter work from PR #827.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
bench/bench_ingest.py Implements ingestion variants, timing, schema management, and result reporting.
bench/run_bench.sh Orchestrates environments, prerequisites, benchmark execution, and summary output.
Comments suppressed due to low confidence (1)

bench/bench_ingest.py:267

  • Every _DecoupledExecutor is constructed with at most concurrency rows. Therefore batch == self.total, run() always takes the early return at lines 195-199, and the submitter thread is never started. Variants A3/E currently benchmark only initial synchronous submission rather than the advertised decoupled executor.
    for start in range(0, n, concurrency):
        chunk = params[start:start + concurrency]
        executor = _DecoupledExecutor(session, prepared, chunk, concurrency)
        executor.run()

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread bench/run_bench.sh
# run_bench.sh -- Run all four ingestion benchmark variants and print comparison.
#
# Prerequisites:
# 1. Run bench/setup_bench.sh first (container, venvs, dataset)
Comment thread bench/run_bench.sh
# 2. ScyllaDB container "scylla-bench" must be running on port 9042
#
# Usage:
# bash bench/run_bench.sh [--variants=A,B,C,D] [--batch-size=100] [--host=127.0.0.1]
Comment thread bench/run_bench.sh
Comment on lines +88 to +90
if ! $RUNTIME exec scylla-bench cqlsh -e "SELECT now() FROM system.local" &>/dev/null; then
echo "ERROR: ScyllaDB container 'scylla-bench' is not responding"
echo " Run: bash bench/setup_bench.sh"
Comment thread bench/bench_ingest.py
Comment on lines +130 to +147
n = len(params)
t0 = time.perf_counter()

# Feed params in chunks matching concurrency to avoid materialising
# a huge intermediate list inside execute_concurrent_with_args.
for start in range(0, n, concurrency):
chunk = params[start:start + concurrency]
execute_concurrent_with_args(session, prepared, chunk,
concurrency=concurrency,
raise_on_first_error=True)
total = start + len(chunk)
if total % PROGRESS_INTERVAL < concurrency:
elapsed = time.perf_counter() - t0
print(f" [{total:>8,} rows] {total/elapsed:,.0f} rows/sec",
file=sys.stderr)

elapsed = time.perf_counter() - t0
return n, elapsed
Comment thread bench/bench_ingest.py
Comment on lines +413 to +418
# TODO: add warmup + multi-run support for rust variant
total, elapsed = ingest_fn((args.host, args.port), CQL_INSERT, params, concurrency)
rows_per_sec = total / elapsed if elapsed > 0 else 0
result = {
"variant": args.variant, "label": label,
"rows": total, "runs": 1,
Comment thread bench/bench_ingest.py
Comment on lines +296 to +297
await s.execute(cql_create_keyspace())
await s.execute(f"USE {KEYSPACE}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants