Skip to content
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

Specialized function dispatchers for very simple functions #944

Merged
merged 1 commit into from
Feb 21, 2025

Conversation

wjakob
Copy link
Owner

@wjakob wjakob commented Feb 21, 2025

Nanobind previously distinguished between a "complex" and a "simple" function dispatcher. This PR adds variants of the simple dispatcher that further specializes to 0 and 1-argument functions without overloads. One common class of functions that benefits are property getters.

The speedup is pretty small (~2%), but we will take it :-).

Nanobind previously distinguished between a "complex" and a "simple"
function dispatcher. This PR adds variants of the simple dispatcher that
further specializes to 0 and 1-argument functions without overloads. One
common class of functions that benefits are property getters.

The speedup is pretty small (~2%), but we will take it :-).
@wjakob wjakob merged commit 7aa69a2 into master Feb 21, 2025
34 checks passed
@wjakob wjakob deleted the dispatcher branch February 21, 2025 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant