-
Notifications
You must be signed in to change notification settings - Fork 61
Improve performance of encoding #64
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
870590e
Use lookup table for decoding
taiki-e 3b75b32
Inline val function
taiki-e ff1d115
Use chunks_exact instead of chunks
taiki-e 4fd0ed8
Use decode_to_slice in Vec::from_hex
taiki-e 3e2aa25
Inline decode_to_slice function
taiki-e f3251bd
Fix build errors
taiki-e 97abf03
Adjust #[inline] on encoding functions
taiki-e 0129182
Use encode_to_slice in encode
taiki-e 19b333d
Use chunks_exact_mut instead of generate_iter
taiki-e 8b9307b
Add encode_to_slice_upper to improve performance of encode_upper
taiki-e e981d8b
Merge branch 'main' into pref
KokaKiwi 5c23286
Merge branch 'pref' of github.com:taiki-e/rust-hex into taiki-e-pref
KokaKiwi ded6948
refactor: improve code style and clarity in src/lib.rs
KokaKiwi 0bf4b24
Apply suggestions from code review
KokaKiwi c965048
Merge branch 'pref' of github.com:taiki-e/rust-hex into taiki-e-pref
KokaKiwi 76f37c7
Merge pull request #62 from taiki-e/pref
KokaKiwi 986b288
Merge branch 'perf-encode' of github.com:taiki-e/rust-hex into taiki-…
KokaKiwi e134cd6
chore: fixup warning
KokaKiwi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
When using from_utf8_unckecked here, it can improve performance by about 8%. (It is safe because we emit only hex characters.)
However, I didn't apply that change because I don't know the policy regarding the unsafe code in this crate.
If It is okay with using unsafe code, I'll add that change.
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.
Some overlap with #66 here I think. In particular I suspect the combination of
ExactSizeIteratorwill allow us to collect into aStringefficiently without indirecting throughVec.