Skip to content

Commit

Permalink
Add some additional extend_query benchmarks for common cases (#1253)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored Oct 13, 2024
1 parent a5de0c0 commit e1a4d51
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion tests/test_url_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,29 @@ def _run() -> None:
BASE_URL.with_query(QUERY_SEQ)


def test_url_extend_query(benchmark: BenchmarkFixture) -> None:
def test_url_extend_query_simple_query_dict(benchmark: BenchmarkFixture) -> None:
@benchmark
def _run() -> None:
for _ in range(25):
BASE_URL.extend_query(SIMPLE_QUERY)


def test_url_extend_query_existing_query_simple_query_dict(
benchmark: BenchmarkFixture,
) -> None:
@benchmark
def _run() -> None:
for _ in range(25):
QUERY_URL.extend_query(SIMPLE_QUERY)


def test_url_extend_query_existing_query_string(benchmark: BenchmarkFixture) -> None:
@benchmark
def _run() -> None:
for _ in range(25):
QUERY_URL.extend_query("x=y&z=1")


def test_url_to_string(benchmark: BenchmarkFixture) -> None:
@benchmark
def _run() -> None:
Expand Down

0 comments on commit e1a4d51

Please sign in to comment.