To include a new algorithm in the benchmarking process, follow these steps:
- Implement the benchmark logic: Create a
run_<algorithm>_benchmark() function in the relevant dataset file (benchmark_core.py or benchmark_news.py). - Create a configuration: Add a new
.toml file in configs/ following the pattern benchmark_<dataset>_<algorithm>.toml. - Register the algorithm: Update
run_benchmark.py to include the new algorithm in the execution logic. - Update the CLI: Add a corresponding command in the
justfile for easy access.
Example implementation in benchmark_core.py:
# In benchmark_core.py
def run_bloom_benchmark(config: Config, labels: dict, id_to_core_id: dict) -> tuple[dict, float]:
timer = Timer()
with timer("BloomFilter"):
bloom_main(config)
# ... evaluation logic
return metrics, timer.timings["BloomFilter"]