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

Add generic for byte order for reading #25

Open
kylebarron opened this issue Nov 5, 2024 · 0 comments · May be fixed by #24
Open

Add generic for byte order for reading #25

kylebarron opened this issue Nov 5, 2024 · 0 comments · May be fixed by #24

Comments

@kylebarron
Copy link
Member

Right now, we dynamically check the endianness every time we read a coordinate. We can't easily monomorphize this at all because we defer reading to later, after we've parsed the geometry.

But it may still be possible to add a generic on the read structs for the byte order.

We should test adding a B: ByteOrder

Because none of the structs are public, this is possible to do completely away from the eyes of the user. So the user doesn't even need to know about the

In theory this could make it faster to read if we're not constantly checking an enum value?

Note that this won't show up on our existing read wkb benchmark because that only reads to wkb objects and doesn't actually read the coordinates themselves. You should first add a bench that converts the WKB to geo types. And then that potentially would show an improvement here from having a generic instead of checking the enum every iteration.

@kylebarron kylebarron linked a pull request Nov 5, 2024 that will close this issue
3 tasks
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 a pull request may close this issue.

1 participant