Closed
Description
Feature or enhancement
Proposal:
As mentioned here, dataclass definition can possibly be sped up by combining the multiple exec
calls into one.
I have two versions, and I found that this results in either a 1.1-1.22 1.26, or 1.37 speedup versus main (old time / new time)
version 1 combines the exec calls by passing a list of name/txt/locals from each function definition. (see below for open pr)
version 2 simplifies the final exec call to avoid __create_fn__
, but I'm not experienced to know if that is safe.
@ericvsmith Let me know if this is a suitable change, and if so, which version we should open a pr based on.
Thank you!
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
https://discuss.python.org/t/improving-dataclasses-startup-performance/15442/18