Replies: 1 comment 1 reply
-
|
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
-
Hi, I notice there is some noticeable performance difference between calling method with positional arguments and kwargs arguments, especially when the method is defined without any
nanobind::arg
.For example,
call1
is the fastest one,call2
with positional arguments is slower,call2
with kwargs arguments is the slowest one.I digged in to the codes and it seems
call1
will be dispatch tonb_func_vectorcall_simple
, as it has no user definednanobind::arg
,call2
is dispatched tonb_func_vectorcall_complex
since it can accept kwargs.However, one thing I don't quite understand is that inside
nb_func_vectorcall_simple
codes, it says it cannot acceptNone
as positional argument:Just curious, is that a specified reason for that?
Beta Was this translation helpful? Give feedback.
All reactions