-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use PEP 590 vectorcall to speed up calls to filter() #87453
Comments
+--------------+--------+----------------------+ Like reversed(https://bugs.python.org/issue41922), it looks okay to update filter() to use PEP-590. |
+0 I don't see any downside. Note, the benchmark only times instantiation of the filter object. It doesn't actually run the iterator which is where most of the runtime cost is spent. So in actual code there is almost zero benefit. For example, add "list" to the statement: stmt="b = list(filter(lambda x: x % 2 == 0, a))" and the improvement disappears. |
Thank you Raymond :) And also I thought that filter is one of the well-used features in Python so it was one of the candidates to apply from my sight. ;) But if this PR only consume maintenance cost, I am okay with not to apply it doesn't matter :) And happy new year Raymond(Sorry I am late ;) But the lunar new year was only 2weeks ago so not too late lol) |
Happy new year to you as well :-) |
FWIW, I don't think there is much of a maintenance burden; hence, the +0. You've already done the work. |
See also bpo-43447: "Generate vectorcall code to parse arguments using Argument Clinic". |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: