Reuse code objects for similar dataclass
definitions
#100930
Labels
3.12
bugs and security fixes
performance
Performance or resource usage
stdlib
Python modules in the Lib dir
A little over a year ago, @dabeaz came up with a cool way of speeding up
dataclass
creation by avoiding unnecessaryexec
calls. Essentially, his proof-of-conceptdataklasses
module caches code objects for methods of "similarly-shaped" dataclasses, and patches them with the correct names:https://github.com/dabeaz/dataklasses
I have a working prototype of a similar idea for the stdlib
dataclasses
module over in #92650. It basically doubles the speed ofdataclass
definitions.CC @ericvsmith
Linked PRs
dataclass
code caching #92650The text was updated successfully, but these errors were encountered: