ruff/crates
Charlie Marsh ed72c027a3
Replace NoHashHasher usages with FxHashMap (#6049)
## Summary

I had always assumed that `NoHashHasher` would be faster when using
integer keys, but benchmarking shows otherwise:

```
linter/default-rules/numpy/globals.py
                        time:   [66.544 µs 66.606 µs 66.678 µs]
                        thrpt:  [44.253 MiB/s 44.300 MiB/s 44.342 MiB/s]
                 change:
                        time:   [-0.1843% +0.1087% +0.3718%] (p = 0.46 > 0.05)
                        thrpt:  [-0.3704% -0.1086% +0.1847%]
                        No change in performance detected.
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild
linter/default-rules/pydantic/types.py
                        time:   [1.3787 ms 1.3811 ms 1.3837 ms]
                        thrpt:  [18.431 MiB/s 18.466 MiB/s 18.498 MiB/s]
                 change:
                        time:   [-0.4827% -0.1074% +0.1927%] (p = 0.56 > 0.05)
                        thrpt:  [-0.1924% +0.1075% +0.4850%]
                        No change in performance detected.
linter/default-rules/numpy/ctypeslib.py
                        time:   [624.82 µs 625.96 µs 627.17 µs]
                        thrpt:  [26.550 MiB/s 26.601 MiB/s 26.650 MiB/s]
                 change:
                        time:   [-0.7071% -0.4908% -0.2736%] (p = 0.00 < 0.05)
                        thrpt:  [+0.2744% +0.4932% +0.7122%]
                        Change within noise threshold.
linter/default-rules/large/dataset.py
                        time:   [3.1585 ms 3.1634 ms 3.1685 ms]
                        thrpt:  [12.840 MiB/s 12.861 MiB/s 12.880 MiB/s]
                 change:
                        time:   [-1.5338% -1.3463% -1.1476%] (p = 0.00 < 0.05)
                        thrpt:  [+1.1610% +1.3647% +1.5577%]
                        Performance has improved.

linter/all-rules/numpy/globals.py
                        time:   [140.17 µs 140.37 µs 140.58 µs]
                        thrpt:  [20.989 MiB/s 21.020 MiB/s 21.051 MiB/s]
                 change:
                        time:   [-0.1066% +0.3140% +0.7479%] (p = 0.14 > 0.05)
                        thrpt:  [-0.7423% -0.3130% +0.1067%]
                        No change in performance detected.
Found 3 outliers among 100 measurements (3.00%)
  2 (2.00%) high mild
  1 (1.00%) high severe
linter/all-rules/pydantic/types.py
                        time:   [2.7030 ms 2.7069 ms 2.7112 ms]
                        thrpt:  [9.4064 MiB/s 9.4216 MiB/s 9.4351 MiB/s]
                 change:
                        time:   [-0.6721% -0.4874% -0.2974%] (p = 0.00 < 0.05)
                        thrpt:  [+0.2982% +0.4898% +0.6766%]
                        Change within noise threshold.
Found 14 outliers among 100 measurements (14.00%)
  12 (12.00%) high mild
  2 (2.00%) high severe
linter/all-rules/numpy/ctypeslib.py
                        time:   [1.4709 ms 1.4727 ms 1.4749 ms]
                        thrpt:  [11.290 MiB/s 11.306 MiB/s 11.320 MiB/s]
                 change:
                        time:   [-1.1617% -0.9766% -0.8094%] (p = 0.00 < 0.05)
                        thrpt:  [+0.8160% +0.9862% +1.1754%]
                        Change within noise threshold.
Found 12 outliers among 100 measurements (12.00%)
  9 (9.00%) high mild
  3 (3.00%) high severe
linter/all-rules/large/dataset.py
                        time:   [5.8086 ms 5.8163 ms 5.8240 ms]
                        thrpt:  [6.9854 MiB/s 6.9946 MiB/s 7.0038 MiB/s]
                 change:
                        time:   [-1.5651% -1.3536% -1.1584%] (p = 0.00 < 0.05)
                        thrpt:  [+1.1720% +1.3721% +1.5900%]
                        Performance has improved.
```

My guess is that `NoHashHasher` underperforms because the keys are not
randomly distributed...

Anyway, it's a ~1% (significant) performance gain on some of the above,
plus we get to remove a dependency.
2023-07-24 23:41:57 +00:00
..
flake8_to_ruff Bump version to 0.0.280 (#5965) 2023-07-21 22:36:13 -04:00
ruff Replace NoHashHasher usages with FxHashMap (#6049) 2023-07-24 23:41:57 +00:00
ruff_benchmark Make lint_only aware of the source kind (#5876) 2023-07-19 09:29:35 +05:30
ruff_cache
ruff_cli Use Flags::intersects rather than Flags::contains (#6007) 2023-07-23 02:59:31 +00:00
ruff_dev Add formatter progress tracking to CI (#5919) 2023-07-24 09:12:42 +00:00
ruff_diagnostics Run nightly Clippy over the Ruff repo (#5670) 2023-07-10 23:44:38 -04:00
ruff_formatter Playground: Fix escaped quotes handling (#5906) 2023-07-20 09:25:27 +00:00
ruff_index Add unreachable code rule (#5384) 2023-07-04 14:27:23 +00:00
ruff_macros Run nightly Clippy over the Ruff repo (#5670) 2023-07-10 23:44:38 -04:00
ruff_python_ast Avoid allocations in SimpleCallArgs (#6021) 2023-07-24 04:55:37 +00:00
ruff_python_formatter Fix formatter with-statement after-as own line comment instability (#6033) 2023-07-24 18:12:07 +00:00
ruff_python_resolver Fix CI by downgrading to cargo insta 1.29.0 (#5589) 2023-07-08 14:54:49 +00:00
ruff_python_semantic Replace NoHashHasher usages with FxHashMap (#6049) 2023-07-24 23:41:57 +00:00
ruff_python_stdlib Fix logging rules with whitespace around dot (#6022) 2023-07-24 05:14:48 +00:00
ruff_python_trivia SimpleTokenizer: Fix infinite loop when lexing empty quotes (#5917) 2023-07-20 15:18:35 +02:00
ruff_rustpython
ruff_shrinking Document formatter error shrinking (#5915) 2023-07-21 11:32:12 +02:00
ruff_textwrap Rename ruff_python_whitespace to ruff_python_trivia (#5886) 2023-07-19 11:48:27 -04:00
ruff_wasm Allow specification of logging.Logger re-exports via logger-objects (#5750) 2023-07-24 00:38:20 -04:00