Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Combine dataclass exec calls #109870

Closed
Assignees
ericvsmith
Labels
performancePerformance or resource usagestdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement
@ssweber

Description

@ssweber

Feature or enhancement

Proposal:

As mentioned here, dataclass definition can possibly be sped up by combining the multipleexec calls into one.

I have two versions, and I found that this results in either a 1.1-1.221.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.
version 2 simplifies the final exec call to avoid__create_fn__, but I'm not experienced to know if that is safe.
(see below for open pr)

@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

Linked PRs

Metadata

Metadata

Assignees

Labels

performancePerformance or resource usagestdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp