Use copy_from_slice instead of copy_memory #173
Labels
No labels
breaking
bug
dependencies
good first issue
help wanted
unstable
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-uuid-rs/uuid#173
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
There is no need to write our own
copy_memorymethod, we can just use<[_]>::copy_from_slicewhich can be implemented in a more optimised way by the standard library.So testing it, it seems our
copy_memoryfunction is faster than builtin<[_]>::copy_from_sliceResults from
cargo +nightly bench --all-features:https://gist.github.com/kinggoesgaming/25a5240ea8741524cdc8dc588ed6b046
Edit: Changes made here for reference https://github.com/uuid-rs/uuid/compare/copy-from-slice
Hmm, I think this might be a bit of test noise, it looks like both methods are emitting the same assembly.
Seemingly it was test noise or just my computer being funny... it is generally faster, but anywhere it is slow, its only slowly by 1-2 nanosecs
#175