Skip to content

Use BestFit layout even for attributes with a short name#6872

Merged
MichaReiser merged 1 commit intomainfrom
best-fit-attributes
Aug 25, 2023
Merged

Use BestFit layout even for attributes with a short name#6872
MichaReiser merged 1 commit intomainfrom
best-fit-attributes

Conversation

@MichaReiser
Copy link
Member

@MichaReiser MichaReiser commented Aug 25, 2023

Summary

This PR fixes a bug where attribute chains starting with a name shorter than 5 characters didn't use the BestFit layout.

Test Plan

This change Increases the similarity index for several projects

project similarity index
cpython 0.76066
django 0.99898
transformers 0.99842
twine 0.99929
typeshed 0.99953
warehouse 0.99637
zulip 0.99920
project similarity index
cpython 0.76067
django 0.99899
transformers 0.99842
twine 0.99929
typeshed 0.99953
warehouse 0.99646
zulip 0.99922

@MichaReiser
Copy link
Member Author

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@MichaReiser MichaReiser added the formatter Related to the formatter label Aug 25, 2023
@github-actions
Copy link
Contributor

PR Check Results

Benchmark

Linux

group                                      main                                   pr
-----                                      ----                                   --
formatter/large/dataset.py                 1.00      4.7±0.25ms     8.6 MB/sec    1.14      5.4±0.19ms     7.6 MB/sec
formatter/numpy/ctypeslib.py               1.00   989.9±54.41µs    16.8 MB/sec    1.08  1067.4±57.15µs    15.6 MB/sec
formatter/numpy/globals.py                 1.00     95.5±7.24µs    30.9 MB/sec    1.04     99.0±7.46µs    29.8 MB/sec
formatter/pydantic/types.py                1.05      2.1±0.11ms    12.4 MB/sec    1.00  1959.0±102.33µs    13.0 MB/sec
linter/all-rules/large/dataset.py          1.00     12.9±0.42ms     3.2 MB/sec    1.02     13.2±0.48ms     3.1 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.03      3.5±0.10ms     4.8 MB/sec    1.00      3.4±0.14ms     4.9 MB/sec
linter/all-rules/numpy/globals.py          1.01   505.0±30.11µs     5.8 MB/sec    1.00   499.5±13.61µs     5.9 MB/sec
linter/all-rules/pydantic/types.py         1.03      7.1±0.25ms     3.6 MB/sec    1.00      6.8±0.19ms     3.7 MB/sec
linter/default-rules/large/dataset.py      1.00      6.9±0.18ms     5.9 MB/sec    1.00      6.8±0.20ms     5.9 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.03  1520.4±72.79µs    11.0 MB/sec    1.00  1478.2±69.43µs    11.3 MB/sec
linter/default-rules/numpy/globals.py      1.03   185.1±11.28µs    15.9 MB/sec    1.00    180.4±8.54µs    16.4 MB/sec
linter/default-rules/pydantic/types.py     1.00      3.0±0.12ms     8.4 MB/sec    1.00      3.0±0.12ms     8.4 MB/sec

Windows

group                                      main                                   pr
-----                                      ----                                   --
formatter/large/dataset.py                 1.00      4.8±0.06ms     8.6 MB/sec    1.11      5.3±0.10ms     7.7 MB/sec
formatter/numpy/ctypeslib.py               1.00   973.6±12.40µs    17.1 MB/sec    1.05  1021.1±15.20µs    16.3 MB/sec
formatter/numpy/globals.py                 1.01    99.4±15.38µs    29.7 MB/sec    1.00     98.3±3.72µs    30.0 MB/sec
formatter/pydantic/types.py                1.00  1937.7±19.90µs    13.2 MB/sec    1.02  1983.5±28.06µs    12.9 MB/sec
linter/all-rules/large/dataset.py          1.01     13.0±0.14ms     3.1 MB/sec    1.00     12.9±0.15ms     3.2 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.00      3.5±0.06ms     4.7 MB/sec    1.00      3.5±0.04ms     4.8 MB/sec
linter/all-rules/numpy/globals.py          1.00    432.7±6.13µs     6.8 MB/sec    1.01    436.0±5.15µs     6.8 MB/sec
linter/all-rules/pydantic/types.py         1.00      6.6±0.11ms     3.8 MB/sec    1.00      6.6±0.09ms     3.8 MB/sec
linter/default-rules/large/dataset.py      1.00      7.0±0.09ms     5.8 MB/sec    1.00      7.0±0.08ms     5.8 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.00  1499.7±20.82µs    11.1 MB/sec    1.00  1494.4±17.38µs    11.1 MB/sec
linter/default-rules/numpy/globals.py      1.00    174.9±3.54µs    16.9 MB/sec    1.01    175.8±2.95µs    16.8 MB/sec
linter/default-rules/pydantic/types.py     1.00      3.1±0.03ms     8.2 MB/sec    1.01      3.2±0.04ms     8.1 MB/sec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

formatter Related to the formatter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants