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

feat: use singular bytes for the jumpmap #402

Merged
merged 1 commit into from Mar 7, 2023

Conversation

onbjerg
Copy link
Collaborator

@onbjerg onbjerg commented Mar 7, 2023

Switches from usize to u8 for easier encoding, and adds some methods to build a jump map from a u8 slice

@rakita
Copy link
Member

rakita commented Mar 7, 2023

Is it better to have u8 or u64?

@onbjerg
Copy link
Collaborator Author

onbjerg commented Mar 7, 2023

There is probably not much of a difference performance wise, but encoding/decoding (which almost always is represented as some operation from X -> &[u8] and &[u8] -> X) will be a lot more annoying with u64, since you would need to turn slices of u64 to slices of u8, and slices of u8 to slices of u64.

@rakita rakita merged commit 33bf8a8 into bluealloy:main Mar 7, 2023
@rakita
Copy link
Member

rakita commented Mar 7, 2023

Yeah, will check in the future if there is some degradation (I assume there is none), and having u8 is easier to handle.

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.

None yet

2 participants