load("@crate_index//:defs.bzl", "aliases", "all_crate_deps")
load("@rules_rust//rust:defs.bzl", "rust_binary")
HAWDB_BENCHMARKS = [
"optimizer_smoke",
"relational_join_execution",
"relational_join_planning",
"aggregate_partial_spill",
"aggregate_hash",
"canonical_point_lookup",
"executor_vectorization",
"index_restart_cost",
"integrity_checksum",
"relational_index_access",
"relational_index_page_cache",
"relational_monotonic_append",
"relational_oltp_mix",
"relational_overflow",
"relational_row_delta_runs",
"relational_row_page_lending",
"search_checkpoint",
"search_generation",
"search_tokenization",
"storage_segment_read",
"store_cow_feasibility",
"vector_projection_scan",
"wal_group_commit",
]
HAWDB_BENCHMARK_TARGETS = [
":hawdb_bench_%s" % benchmark
for benchmark in HAWDB_BENCHMARKS
]
HAWDB_MANUAL_BENCHMARKS = [
"branch_catalog_inspection",
"concurrent_snapshot_reads",
"mvcc_hot_paths",
"concurrent_writers",
"consumer_publication",
"graph_analytics",
"host_boundary",
"host_boundary_allocations",
"mem_query_concurrency",
"mem_query_resources",
"mixed_point_growth",
"retained_source_capacity",
]
def hawdb_benchmark_binaries(crate_features):
benchmark_deps = all_crate_deps(normal = True, normal_dev = True) + [
":hawdb",
"//crates/core:hawdb_core",
"//crates/executor:hawdb_executor",
"//crates/integrity:hawdb_integrity",
"//crates/optimizer:hawdb_optimizer",
"//crates/qos:hawdb_qos",
"//crates/storage:hawdb_storage",
"//crates/vector-projection:hawdb_vector_projection",
]
for benchmark in HAWDB_BENCHMARKS + HAWDB_MANUAL_BENCHMARKS:
shared_srcs = [
"benches/host_boundary/workload.rs",
"benches/host_boundary/checksum.rs",
"//bindings/benchmarks:native_alloc.rs",
] if benchmark == "host_boundary_allocations" else [
"//bindings/benchmarks:native_alloc.rs",
] if benchmark in ["mem_query_concurrency", "mem_query_resources"] else []
rust_binary(
name = "hawdb_bench_%s" % benchmark,
crate_root = "benches/%s.rs" % benchmark,
crate_features = crate_features,
srcs = ["benches/%s.rs" % benchmark] + native.glob([
"benches/%s/**/*.rs" % benchmark,
], allow_empty = True) + shared_srcs,
edition = "2024",
tags = ["manual"] if benchmark in HAWDB_MANUAL_BENCHMARKS else [],
aliases = aliases(
normal = True,
normal_dev = True,
proc_macro = True,
proc_macro_dev = True,
),
deps = benchmark_deps,
proc_macro_deps = all_crate_deps(
proc_macro = True,
proc_macro_dev = True,
),
)
native.alias(
name = "hawdb_bench_relational_index_access_release",
actual = ":hawdb_bench_relational_index_access",
tags = ["manual"],
)