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

Allow functions to be inlined #4

Closed
wants to merge 1 commit into from
Closed

Conversation

as-com
Copy link

@as-com as-com commented Jan 16, 2022

I noticed that functions in this crate aren't being inlined in generated code, which comes with a severe performance penalty given how tiny some of these functions are. This PR adds #[inline(always)] annotations to the trait implementations to prevent this from happening.

I also noticed that funty 2.0 hasn't yet been pushed to GitHub, so this PR is against version 1.2. Given how commonly older versions of funty are used in the wild (based on crates.io download stats) and also the performance implications, this fix should probably be backported to 1.1, 1.2, and 2.0 branches.

@myrrlyn
Copy link
Collaborator

myrrlyn commented Nov 16, 2022

You are so right I completely forgot about that. I am rewriting most of the crate for v3 so I think this PR is about to extremely Not Apply (sorry) but I will definitely take your advice and publish updates on the earlier series as well.

Thanks for the PR, and I'm sorry about (a) the long delay and (b) the ... having done it myself before I saw this, and therefore not merging :/ I do appreciate the effort though, sincerely.

@myrrlyn myrrlyn closed this Nov 16, 2022
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.

2 participants