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

Printer: Remove unused state fields #6548

Merged
merged 1 commit into from
Aug 14, 2023
Merged

Conversation

MichaReiser
Copy link
Member

Summary

This PR removes the two generated_* fields that the Printer only ever wrote to but never read. I further changed the line_width to a u32 because it is sufficient to support files up to 4GB

Test Plan

cargo test

@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

Benchmark

Linux

group                                      main                                   pr
-----                                      ----                                   --
formatter/large/dataset.py                 1.00      4.1±0.02ms     9.9 MB/sec    1.01      4.1±0.03ms     9.9 MB/sec
formatter/numpy/ctypeslib.py               1.00    781.0±2.66µs    21.3 MB/sec    1.00    778.4±5.99µs    21.4 MB/sec
formatter/numpy/globals.py                 1.01     80.0±0.23µs    36.9 MB/sec    1.00     79.0±0.58µs    37.3 MB/sec
formatter/pydantic/types.py                1.00   1651.4±9.44µs    15.4 MB/sec    1.00  1648.9±10.73µs    15.5 MB/sec
linter/all-rules/large/dataset.py          1.01     10.4±0.05ms     3.9 MB/sec    1.00     10.4±0.06ms     3.9 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.01      2.8±0.04ms     5.9 MB/sec    1.00      2.8±0.01ms     6.0 MB/sec
linter/all-rules/numpy/globals.py          1.00    396.2±1.02µs     7.4 MB/sec    1.00    398.0±2.77µs     7.4 MB/sec
linter/all-rules/pydantic/types.py         1.00      5.4±0.03ms     4.7 MB/sec    1.00      5.4±0.04ms     4.7 MB/sec
linter/default-rules/large/dataset.py      1.00      5.5±0.02ms     7.5 MB/sec    1.00      5.4±0.02ms     7.5 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.01  1214.3±21.15µs    13.7 MB/sec    1.00   1200.8±5.20µs    13.9 MB/sec
linter/default-rules/numpy/globals.py      1.00    144.4±5.62µs    20.4 MB/sec    1.04    150.6±5.96µs    19.6 MB/sec
linter/default-rules/pydantic/types.py     1.00      2.5±0.02ms    10.3 MB/sec    1.00      2.5±0.01ms    10.4 MB/sec

Windows

group                                      main                                   pr
-----                                      ----                                   --
formatter/large/dataset.py                 1.02      5.4±0.35ms     7.6 MB/sec    1.00      5.3±0.31ms     7.7 MB/sec
formatter/numpy/ctypeslib.py               1.00   973.6±46.25µs    17.1 MB/sec    1.04  1008.9±77.21µs    16.5 MB/sec
formatter/numpy/globals.py                 1.00    94.5±12.76µs    31.2 MB/sec    1.02     96.8±5.31µs    30.5 MB/sec
formatter/pydantic/types.py                1.00      2.1±0.09ms    12.4 MB/sec    1.05      2.2±0.17ms    11.8 MB/sec
linter/all-rules/large/dataset.py          1.04     16.1±0.49ms     2.5 MB/sec    1.00     15.4±0.43ms     2.6 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.03      4.4±0.13ms     3.8 MB/sec    1.00      4.3±0.16ms     3.9 MB/sec
linter/all-rules/numpy/globals.py          1.01   551.8±37.92µs     5.3 MB/sec    1.00   547.2±29.45µs     5.4 MB/sec
linter/all-rules/pydantic/types.py         1.05      8.4±0.26ms     3.0 MB/sec    1.00      8.0±0.23ms     3.2 MB/sec
linter/default-rules/large/dataset.py      1.00      8.5±0.36ms     4.8 MB/sec    1.01      8.6±0.26ms     4.7 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.00  1813.4±74.41µs     9.2 MB/sec    1.10      2.0±0.13ms     8.3 MB/sec
linter/default-rules/numpy/globals.py      1.00   234.1±10.28µs    12.6 MB/sec    1.03   241.4±13.94µs    12.2 MB/sec
linter/default-rules/pydantic/types.py     1.00      3.8±0.12ms     6.6 MB/sec    1.06      4.1±0.16ms     6.3 MB/sec

@MichaReiser MichaReiser added the internal An internal refactor or improvement label Aug 14, 2023
@MichaReiser MichaReiser force-pushed the remove-unused-printer-fields branch from 7f83eeb to 055af52 Compare August 14, 2023 08:21
@MichaReiser MichaReiser mentioned this pull request Aug 14, 2023
Base automatically changed from formatter-bench-only-measure-formatting-time to main August 14, 2023 08:25
@MichaReiser MichaReiser force-pushed the remove-unused-printer-fields branch from 055af52 to 8eb36fa Compare August 14, 2023 08:26
@MichaReiser MichaReiser merged commit 24f42f0 into main Aug 14, 2023
@MichaReiser MichaReiser deleted the remove-unused-printer-fields branch August 14, 2023 09:08
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