-
Notifications
You must be signed in to change notification settings - Fork 237
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
Inline some small functions #38
Conversation
Nice! |
With just inlining
I believe for small functions like those one-liners and factory functions inlining a pub fn should be fine. I know that |
If we just wanted to inline local functions then with inlining
It looks like its actually faster for some benchmarks with just those three inlined than with what I submitted in this pull request. |
Good! I'd prefer that indeed, there is not much to gain from inlining pub On 27 Aug 2016 10:03, "James Hurst" notifications@github.com wrote: If we just wanted to inline local functions then with inlining test bench_quick_xml ... bench: 624,222 ns/iter (+/- 130,794) — Reply to this email directly, view it on GitHub |
As for only optimizing only those benchmarks in the benches and not real cases. Here are the speeds I get in my library's benchmarks with the three inlines:
With the version on crates.io I get:
|
I'm not with my computer, I'll publish a new version on crates.io asap. |
Sounds good! 👍 If you could test out #37 before you push the new version that'd be great. |
#37 merged and published v0.4.0. |
By adding the
#[inline]
attribute to these one line functions we can improve performance by quite a bit.Before:
After: