-
Notifications
You must be signed in to change notification settings - Fork 60
Increase the #[inline] opportunities - 15-40% performance improvements #100
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
Enable performance improvements to be tracked over time more easily.
@@ -482,6 +488,7 @@ impl GraphemeCursor { | |||
self.state = GraphemeState::Emoji; | |||
} | |||
|
|||
#[inline] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should probably go below the docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I thought I saw this pattern somewhere else in the crate and decided to follow. Will submit a follow-up PR that moves all of them below the docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good!
@@ -563,6 +570,7 @@ impl GraphemeCursor { | |||
} | |||
} | |||
|
|||
#[inline] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
Could a new release be cut to ship these changes? It's a significant difference. |
Published 1.8.0! |
This PR increases the number of (internal) functions that are given an opportunity to be inlined during grapheme detection.
Benchmarking indicates that this change results in a significant performance improvement (see below).
This PR also replaces bencher with criterion to enable continued performance monitoring.