Skip to content

Commit

Permalink
Add unquoting benchmarks (#1291)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored Oct 16, 2024
1 parent c6d46ae commit 37dae7c
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions tests/test_quoting_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,29 @@ def _run() -> None:
QUERY_QUOTER(LONG_QUERY_WITH_PCT)


def test_quoter_quote(benchmark: BenchmarkFixture) -> None:
def test_quoter_quote_utf8(benchmark: BenchmarkFixture) -> None:
@benchmark
def _run() -> None:
for _ in range(100):
QUOTER("/шлях/файл")


def test_unquoter(benchmark: BenchmarkFixture) -> None:
def test_unquoter_short(benchmark: BenchmarkFixture) -> None:
@benchmark
def _run() -> None:
for _ in range(100):
UNQUOTER("/path/to")


def test_unquoter_long_ascii(benchmark: BenchmarkFixture) -> None:
@benchmark
def _run() -> None:
for _ in range(100):
UNQUOTER(LONG_QUERY)


def test_unquoter_long_pct(benchmark: BenchmarkFixture) -> None:
@benchmark
def _run() -> None:
for _ in range(100):
UNQUOTER(LONG_QUERY_WITH_PCT)

0 comments on commit 37dae7c

Please sign in to comment.