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

vec vs u8 #24

Merged
merged 2 commits into from
Feb 7, 2023
Merged

vec vs u8 #24

merged 2 commits into from
Feb 7, 2023

Conversation

ckcr4lyf
Copy link
Owner

@ckcr4lyf ckcr4lyf commented Feb 7, 2023

We know it's only 6 bytes, don't need vec

@ckcr4lyf
Copy link
Owner Author

ckcr4lyf commented Feb 7, 2023

image

Redis performance is indifferent

However, the initial parsing into the [u8; 6] is faster than Vec<u8> :

IP str to bytes/vec     time:   [120.36 ns 123.52 ns 126.92 ns]
IP str to bytes/u8      time:   [32.511 ns 32.607 ns 32.715 ns]

@ckcr4lyf ckcr4lyf merged commit 156bded into master Feb 7, 2023
@ckcr4lyf ckcr4lyf deleted the patch/u8-vs-vecu8 branch September 4, 2024 03:07
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.

1 participant