Skip to content
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

Remove lex and parsing from formatter benchmark #6547

Merged
merged 1 commit into from
Aug 14, 2023

Conversation

MichaReiser
Copy link
Member

Summary

This PR changes the formatter benchmark to only benchmark the formatting time by excluding the lexing and parsing time.

Excluding the lexing and parsing time (which make up more than 50% of the whole formatting time) allows us to more cleary identify performance changes in the formatter itself.
It further helps to gather profiles that don't include the whole parsing noise.

@MichaReiser
Copy link
Member Author

MichaReiser commented Aug 14, 2023

@github-actions
Copy link
Contributor

github-actions bot commented Aug 14, 2023

PR Check Results

Ecosystem

✅ ecosystem check detected no changes.

Benchmark

Linux

group                                      main                                   pr
-----                                      ----                                   --
formatter/large/dataset.py                 2.05      8.4±0.03ms     4.9 MB/sec    1.00      4.1±0.02ms    10.0 MB/sec
formatter/numpy/ctypeslib.py               2.14  1665.2±32.43µs    10.0 MB/sec    1.00    777.8±2.91µs    21.4 MB/sec
formatter/numpy/globals.py                 2.44    195.7±7.46µs    15.1 MB/sec    1.00     80.0±0.29µs    36.9 MB/sec
formatter/pydantic/types.py                2.12      3.5±0.10ms     7.3 MB/sec    1.00  1651.8±16.78µs    15.4 MB/sec
linter/all-rules/large/dataset.py          1.00     10.2±0.02ms     4.0 MB/sec    1.00     10.2±0.07ms     4.0 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.00      2.8±0.01ms     6.0 MB/sec    1.00      2.8±0.01ms     6.0 MB/sec
linter/all-rules/numpy/globals.py          1.00    396.2±1.95µs     7.4 MB/sec    1.00    396.5±0.93µs     7.4 MB/sec
linter/all-rules/pydantic/types.py         1.01      5.4±0.04ms     4.8 MB/sec    1.00      5.3±0.01ms     4.8 MB/sec
linter/default-rules/large/dataset.py      1.00      5.4±0.02ms     7.6 MB/sec    1.01      5.4±0.01ms     7.5 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.00  1194.9±13.23µs    13.9 MB/sec    1.01   1205.3±2.12µs    13.8 MB/sec
linter/default-rules/numpy/globals.py      1.03    145.8±6.59µs    20.2 MB/sec    1.00    141.8±0.40µs    20.8 MB/sec
linter/default-rules/pydantic/types.py     1.00      2.4±0.01ms    10.4 MB/sec    1.01      2.5±0.04ms    10.4 MB/sec

Windows

group                                      main                                    pr
-----                                      ----                                    --
formatter/large/dataset.py                 2.19     11.3±0.83ms     3.6 MB/sec     1.00      5.2±0.26ms     7.9 MB/sec
formatter/numpy/ctypeslib.py               2.51      2.2±0.23ms     7.5 MB/sec     1.00   890.6±48.63µs    18.7 MB/sec
formatter/numpy/globals.py                 2.88   255.8±33.59µs    11.5 MB/sec     1.00     88.8±7.46µs    33.2 MB/sec
formatter/pydantic/types.py                2.19      4.6±0.25ms     5.6 MB/sec     1.00      2.1±0.16ms    12.2 MB/sec
linter/all-rules/large/dataset.py          1.00     16.7±1.01ms     2.4 MB/sec     1.00     16.7±0.89ms     2.4 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.02      4.4±0.21ms     3.8 MB/sec     1.00      4.3±0.22ms     3.9 MB/sec
linter/all-rules/numpy/globals.py          1.02   554.1±27.94µs     5.3 MB/sec     1.00   544.1±20.49µs     5.4 MB/sec
linter/all-rules/pydantic/types.py         1.04      8.6±0.45ms     3.0 MB/sec     1.00      8.3±0.35ms     3.1 MB/sec
linter/default-rules/large/dataset.py      1.00      8.2±0.57ms     4.9 MB/sec     1.08      8.9±0.35ms     4.6 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.00  1824.4±113.58µs     9.1 MB/sec    1.04  1901.3±74.47µs     8.8 MB/sec
linter/default-rules/numpy/globals.py      1.00   234.8±18.89µs    12.6 MB/sec     1.02   240.3±12.73µs    12.3 MB/sec
linter/default-rules/pydantic/types.py     1.00      3.7±0.15ms     6.8 MB/sec     1.05      3.9±0.15ms     6.5 MB/sec

@MichaReiser MichaReiser added the internal An internal refactor or improvement label Aug 14, 2023
@MichaReiser MichaReiser merged commit 51ae47a into main Aug 14, 2023
@MichaReiser MichaReiser deleted the formatter-bench-only-measure-formatting-time branch August 14, 2023 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal An internal refactor or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants