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

Put a custom `@property` in place of slotted `@cached_property` for documentation purposes

#1512Closed
Comparing
clayote:cache_property
(
9729fe4
) with
main
(
c44b8b0
)
CodSpeed Performance Gauge
-82%
Improvement
2
Regression
1
Untouched
12

Benchmarks

15 total
test_repeated_access
bench/test_benchmarks.py::TestCachedProperties
CodSpeed Performance Gauge
-82%
238.5 µs1,330.1 µs
test_first_access
bench/test_benchmarks.py::TestCachedProperties
CodSpeed Performance Gauge
×2.8
6.4 ms2.3 ms
test_create_cached_property_class
bench/test_benchmarks.py::TestCachedProperties
CodSpeed Performance Gauge
+20%
2 s1.7 s
test_asdict_atomic
bench/test_benchmarks.py
CodSpeed Performance Gauge
+1%
6.6 ms6.6 ms
test_asdict_complicated
bench/test_benchmarks.py
CodSpeed Performance Gauge
0%
10 ms9.9 ms
test_astuple_complicated
bench/test_benchmarks.py
CodSpeed Performance Gauge
0%
9.4 ms9.4 ms
test_eq_equal
bench/test_benchmarks.py
CodSpeed Performance Gauge
0%
851.9 µs851.7 µs
test_create_frozen_class
bench/test_benchmarks.py
CodSpeed Performance Gauge
0%
1.5 s1.5 s
test_instantiate_with_defaults
bench/test_benchmarks.py
CodSpeed Performance Gauge
0%
1.3 ms1.3 ms
test_create_simple_class
bench/test_benchmarks.py
CodSpeed Performance Gauge
0%
1.2 s1.2 s
test_eq_unequal
bench/test_benchmarks.py
CodSpeed Performance Gauge
0%
654 µs654 µ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_create_simple_class_make_class
bench/test_benchmarks.py
CodSpeed Performance Gauge
0%
1.2 s1.2 s
test_astuple_atomic
bench/test_benchmarks.py
CodSpeed Performance Gauge
0%
6 ms6 ms

Commits

Click on a commit to change the comparison range
Base
main
c44b8b0
-87.08%
Replace `@cached_property` with a `@property` for documentation purposes
716d219
21 hours ago
by clayote
-5.98%
Fix repeat cached_property calls
8a8bd46
19 hours ago
by clayote
-0.02%
[pre-commit.ci] auto fixes from pre-commit.com hooks
d126565
19 hours ago
by pre-commit-ci[bot]
-5.38%
Go back to the try-catch, but call `__get__` directly
0609b6e
18 hours ago
by clayote
0%
Add `test_slots_cached_property_has_docstring`
5a9630a
18 hours ago
by clayote
0%
[pre-commit.ci] auto fixes from pre-commit.com hooks
00b0608
17 hours ago
by pre-commit-ci[bot]
0%
Merge remote-tracking branch 'origin/cache_property' into cache_property
6a5daa7
17 hours ago
by clayote
0%
[pre-commit.ci] auto fixes from pre-commit.com hooks
99503eb
17 hours ago
by pre-commit-ci[bot]
0%
[pre-commit.ci] auto fixes from pre-commit.com hooks
0d2721a
17 hours ago
by pre-commit-ci[bot]
0%
Merge remote-tracking branch 'origin/cache_property' into cache_property
ef78167
17 hours ago
by clayote
0%
Fix some off-by-one errors copying multiline docstrings
6b4ba4a
17 hours ago
by clayote
0%
Paper over the differences in newline and indent of docstrings between Python versions
fe0e78a
16 hours ago
by clayote
0%
[pre-commit.ci] auto fixes from pre-commit.com hooks
6550e0d
16 hours ago
by pre-commit-ci[bot]
0%
Merge remote-tracking branch 'origin/cache_property' into cache_property
7670522
16 hours ago
by clayote
0%
[pre-commit.ci] auto fixes from pre-commit.com hooks
1839756
16 hours ago
by pre-commit-ci[bot]
0%
Merge remote-tracking branch 'origin/cache_property' into cache_property
aca32a5
16 hours ago
by clayote
0%
Support string return annotation
9efd912
16 hours ago
by clayote
+4.47%
Avoid `getattr_static` in `_make_cached_property_getattr`
e27c582
3 hours ago
by clayote
+0.01%
Use the descriptor's `__set__` method directly in `_make_cached_property_getattr`
fedc668
3 hours ago
by clayote
+0.05%
Optimize in `_make_cached_property_getattr`
393c804
3 hours ago
by clayote
+2.06%
Make the generated `@property` really act like a `@cached_property`
937c1c2
2 hours ago
by clayote
0%
[pre-commit.ci] auto fixes from pre-commit.com hooks
77da557
2 hours ago
by pre-commit-ci[bot]
+5.56%
Merge remote-tracking branch 'origin/cache_property' into cache_property
ab9de61
2 hours ago
by clayote
+0.15%
Trivially optimize `_make_cached_property_uncached`
2391242
2 hours ago
by clayote
+1.77%
Cache the cached property descriptors in a global var
dd7a45f
1 hour ago
by clayote
-0.26%
[pre-commit.ci] auto fixes from pre-commit.com hooks
ef378ac
1 hour ago
by pre-commit-ci[bot]
+2.58%
Merge remote-tracking branch 'origin/cache_property' into cache_property
35e023f
56 minutes ago
by clayote
0%
[pre-commit.ci] auto fixes from pre-commit.com hooks
9729fe4
55 minutes ago
by pre-commit-ci[bot]
© 2026 CodSpeed Technology
Home Terms Privacy Docs