Optimize builtin functions min() and max() #199
colorfulappl
started this conversation in
General
Replies: 1 comment 1 reply
-
Can you please make a PR? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Builtin functions
min()
andmax()
are labeled asMETH_VARARGS | METH_KEYWORDS
, which usetp_call
calling convention.After changing their label to
METH_FASTCALL | METH_KEYWORDS
, they can be invoked byvectorcall
.This optimization simplifies parameter passing and avoids creation of temporary tuple while parsing arguments, brings about up to 200%+ speed up on microbenchmarks.
Result of microbenchmarks:
Beta Was this translation helpful? Give feedback.
All reactions