Skip to content

Add benchmark script #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 12, 2024
Merged

Add benchmark script #61

merged 1 commit into from
Mar 12, 2024

Conversation

bbayles
Copy link
Collaborator

@bbayles bbayles commented Mar 12, 2024

This PR adds a benchmark script for comparing to urllib.parse.urllparse.

The WPT test URLs are available in already in the test suite, so I used them for comparison.

Resolves #59

@bbayles bbayles merged commit 91a641e into main Mar 12, 2024
8 checks passed
@bbayles bbayles deleted the benchmark-script branch March 12, 2024 20:55
@TkTech
Copy link

TkTech commented Mar 12, 2024

Can I recommend taking a look at pytest-benchmark? It's fantastic for theses kinds of things and gives you a lot of things for free such as historical comparisons across revisions and candlestick graphs. An example would be https://github.com/tktech/json_benchmark

@TkTech
Copy link

TkTech commented Mar 16, 2024

Benchmark here: https://github.com/TkTech/can_ada/blob/main/tests/test_benchmark.py

Example result:

------------------------------------------------------------------------------------- benchmark: 3 tests ------------------------------------------------------------------------------------
Name (time in ms)              Min                 Max                Mean            StdDev              Median               IQR            Outliers      OPS            Rounds  Iterations
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_can_ada_parse         56.2407 (1.0)       57.6925 (1.0)       56.5463 (1.0)      0.3602 (1.0)       56.4612 (1.0)      0.1668 (1.0)           2;2  17.6846 (1.0)          18           1
test_ada_python_parse     111.5972 (1.98)     114.5352 (1.99)     112.3024 (1.99)     0.9312 (2.59)     112.0620 (1.98)     0.3644 (2.18)          1;1   8.9045 (0.50)          8           1
test_urllib_parse         257.6146 (4.58)     258.9225 (4.49)     258.1783 (4.57)     0.4893 (1.36)     258.1076 (4.57)     0.6176 (3.70)          2;0   3.8733 (0.22)          5           1
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add benchmarks
4 participants