Avatar for the python-attrs user
python-attrs
attrs
BlogDocsChangelog

Speed up __eq__

#1310Merged
Comparing
tin/faster-eq
(
828e055
) with
main
(
feb7a4d
)
CodSpeed Performance Gauge
+63%
Improvement
2
Untouched
6

Benchmarks

8 total
test_eq_unequal
bench/test_benchmarks.py
CodSpeed Performance Gauge
+63%
1,098.1 µs672.7 µs
test_eq_equal
bench/test_benchmarks.py
CodSpeed Performance Gauge
+30%
1,136.4 µs873.3 µs
test_create_simple_class_make_class
bench/test_benchmarks.py
CodSpeed Performance Gauge
+1%
1.5 s1.5 s
test_create_simple_class
bench/test_benchmarks.py
CodSpeed Performance Gauge
+1%
1.5 s1.5 s
test_create_frozen_class
bench/test_benchmarks.py
CodSpeed Performance Gauge
+1%
1.7 s1.7 s
test_hash
bench/test_benchmarks.py
CodSpeed Performance Gauge
0%
1.2 ms1.2 ms
test_instantiate_no_defaults
bench/test_benchmarks.py
CodSpeed Performance Gauge
0%
1.3 ms1.3 ms
test_instantiate_with_defaults
bench/test_benchmarks.py
CodSpeed Performance Gauge
0%
1.3 ms1.3 ms

Commits

Click on a commit to change the comparison range
Base
main
feb7a4d
+62.88%
Speed up __eq__
af94789
2 years ago
by Tinche
-0.01%
Changelog, disallow nans in tests
15b9bcf
2 years ago
by Tinche
+0.04%
Fix `eq_key` comparisons
abd2ed4
2 years ago
by Tinche
-0.04%
Rework changlelog
d716405
2 years ago
by Tinche
+0.3%
[pre-commit.ci] auto fixes from pre-commit.com hooks
9e7fb41
2 years ago
by pre-commit-ci[bot]
+0.08%
Make docs more precise
828e055
2 years ago
by Tinche
© 2026 CodSpeed Technology
Home Terms Privacy Docs