apache / apache/sedona-db

chore: pytest-benchmark creates and loads all tables even if they aren't needed

Open
#196 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
503
Forks
61
Avg merge
2d 5h
Merged PRs (30d)
91

Description

In most cases when running th pytest-benchmark, we only run one function. The current code creates all of these tables for each of the three engines, regardless of whether the table or engine is used.

https://github.com/apache/sedona-db/blob/abcd1409bc35cb2ef7f69bbba708cbb6984720fc/benchmarks/test_bench_base.py#L30-L78

We create only the tables that are requested (e.g `polygon_simple`) and only for the engines that are requested (e.g DuckDB, SedonaDB, PostGIS). DuckDB and PostGIS aren't always used because they don't always support the function being benched.

Contributor guide

Open the contributing guide

Research direction

Start in benchmarks/test_bench_base.py at lines 30-78 and inspect how pytest-benchmark selects functions, tables, and engines. Run the relevant benchmark setup to confirm the current behavior; done means only requested tables and engines are created and loaded, without preparing unused combinations.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
databases, performance, testing-qa
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.