dynaxis commented on issue #686:
URL:
https://github.com/apache/datasketches-java/issues/686#issuecomment-3345074994
@leerho a bit off topic, but here is why. I wanted to have more control over
the memory layout of the data structures I need. So evaluated FFM as a means to
implement C struct-likes. So for my case, the off-heap memory was not a
critical requirement.
Different from `Unsafe`, it was really difficult to get rid of the bound
check overhead completely. In the end, I've ended up with generating the
flattened class at the compile time and leveraged Kotlin's value class to wrap
around the flattened class instances to provide a more convenient API. The code
generation approach was so efficient that the performance gap with FFM was
quite huge, and it was proven to be fairly neat for my project after
prototyping the approach.
With the FFM, it was difficult to achieve a comparable performance. Maybe I
lack some important knowledge on the FFM. But my code using FFM was quite
comparable in performance with that with ByteBuffer, so I think I was not
completely wrong with my use of the FFM.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]