Skip to content

Commit

Permalink
Add a benchmark for accessing the raw_host with an empty cache (#1337)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored Oct 19, 2024
1 parent 5803ffc commit 7cdbf04
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_url_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,16 @@ def _run() -> None:
url.raw_host


def test_raw_host_empty_cache(benchmark: BenchmarkFixture) -> None:
url = URL("http://www.domain.tld")

@benchmark
def _run() -> None:
for _ in range(100):
url._cache = {}
url.raw_host


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

0 comments on commit 7cdbf04

Please sign in to comment.