Freeze models
#1110
Replies: 1 comment
-
Under the current design there's one outlier of |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This idea was originally proposed by @FasterSpeeding in #611, but it got closed in the end due to a performance difference between frozen and un-frozen attr classes (about 300ns on a laptop according to the documentation).
I recently wanted to see if I could get that difference down and ended up speeding creation of frozen classes by 10%, closing the gap a bit more (python-attrs/attrs#898). Might try and reduce it a bit more in the future, but I highly doubt I will get anywhere.
Note that there is no release on PyPI with that code just yet
Even with that performance hit, we could freeze all models to ensure inmutability and make the cache more efficient by removing all the copy calls, which #611 did.
Beta Was this translation helpful? Give feedback.
All reactions