-
Notifications
You must be signed in to change notification settings - Fork 442
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
PackedCoordinateSequence separated arrays variant #672
base: master
Are you sure you want to change the base?
PackedCoordinateSequence separated arrays variant #672
Conversation
6ea7a4b
to
6681658
Compare
Signed-off-by: Björn Harrtell <[email protected]>
6681658
to
4541012
Compare
@dr-jts can I get your opinion on this? |
Aside: Have you had success with this memory format? I was trying it out recently, in the hopes I could vectorize some operations, but I found significant overhead that swamped any SIMD benefits. |
@jagill when designing FlatGeobuf I was opting between a single array with dimensions as stride or the one I described here. I couldn't find any pro/cons with either and the choice was ultimately decided by that GDAL has that model and that 3D wasn't a primary goal at the time. I'm perhaps regretting it now but I still don't feel there is a clear winner. I do not have any experience with SIMD. Which memory model would you say is ideal? |
I don't know which model is ideal. A flat strided array
But so far I have not succeeded in making separate arrays faster than a strided array. I suspect -- since most computations only use |
@jagill thanks for your thoughts, they give me some comfort that perhaps the memory model I've chosen isn't bad. :) |
I just remember another rationale for the paired XY layout and it's basically that X is more or less useless without Y but other dimensions and/or measures are more standalone. |
This PR implements a third variant of the PackedCoordinateSequence implementations named Double2 for lack of a better name.
This variant explicitly uses three arrays (XY, Z and M respectively) instead of a stride based single array as the other two implementations do.
The motivation of adding this variant is to support a more direct and efficient way to interop with memory models of this layout. Popular examples of this memory model are GDAL and QGIS. It's also the memory model I chose for my own FlatGeobuf format and is the main reason for me wanting this (to be able to more efficiently use FlatGeobuf with JTS or ports of it).