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

ClassBuilder: eval only once

#1407Merged
Comparing
tin/speed-up-eval
(
f799f56
) with
main
(
e048efc
)
CodSpeed Performance Gauge
+52%
Improvements
3
Untouched
5

Benchmarks

Improved

test_create_simple_class_make_class
bench/test_benchmarks.py::test_create_simple_class_make_class
CodSpeed Performance Gauge
+52%
1,496.7 ms982.9 ms
test_create_simple_class
bench/test_benchmarks.py::test_create_simple_class
CodSpeed Performance Gauge
+47%
1.5 s1 s
test_create_frozen_class
bench/test_benchmarks.py::test_create_frozen_class
CodSpeed Performance Gauge
+38%
1.8 s1.3 s

Passed

test_eq_unequal
bench/test_benchmarks.py::test_eq_unequal
CodSpeed Performance Gauge
+1%
669.7 µs665.2 µs
test_eq_equal
bench/test_benchmarks.py::test_eq_equal
CodSpeed Performance Gauge
0%
875.3 µs871 µs
test_hash
bench/test_benchmarks.py::test_hash
CodSpeed Performance Gauge
0%
1.1 ms1.1 ms
test_instantiate_no_defaults
bench/test_benchmarks.py::test_instantiate_no_defaults
CodSpeed Performance Gauge
0%
1.2 ms1.2 ms
test_instantiate_with_defaults
bench/test_benchmarks.py::test_instantiate_with_defaults
CodSpeed Performance Gauge
0%
1.2 ms1.2 ms

Commits

Click on a commit to change the comparison range
Base
main
e048efc
-91.07%
ClassBuilder: eval only once
0dc578e
7 months ago
by Tinche
+0.07%
avoid Attribute.evolve
6618a8e
7 months ago
by Tinche
+0.12%
speed up `_add_method_dunders`
8fe3d00
7 months ago
by Tinche
+0.02%
[pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci
cb5d376
7 months ago
by pre-commit-ci[bot]
-0.03%
optimize _CountingAttrs more
011f82a
7 months ago
by Tinche
+0.04%
Fix up `_add_method_dunders`
b6feb8b
7 months ago
by Tinche
+30.77%
avoid a hot splitlines
532faed
7 months ago
by Tinche
×2.1
restore old type_hash
dc342b4
7 months ago
by Tinche
-0.77%
fix scriptlines handling
4e0af4b
7 months ago
by Tinche
+0.01%
restore contextlib.suppress
cb60fff
7 months ago
by Tinche
-1%
add some hints
7c51993
7 months ago
by Tinche
+0.01%
fix tests
7721e18
7 months ago
by Tinche
+0.06%
Refactor `_Attributes`
9d33ef8
7 months ago
by Tinche
+0.02%
Reflow
6e3826f
7 months ago
by Tinche
-0.02%
Reflow docs
f16a89f
7 months ago
by Tinche
0%
Microoptimization
20ce81d
7 months ago
by Tinche
+0.03%
Fix arg name
54b39ae
7 months ago
by Tinche
-0.01%
Add changelog entry
f799f56
7 months ago
by Tinche
© 2025 CodSpeed Technology
Home Terms Privacy Docs