-
Notifications
You must be signed in to change notification settings - Fork 831
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
Option for ByteBufferOutput#require to allocate a heap buffer #161
Comments
Thanks for this report. I think it is a good idea. I simply overlooked that I always allocate direct buffers, even if the original one was on heap. I'll fix this part soon and will check the type of buffer used at construction when resizing. Regarding a dedicated option (e.g. a constructor argument), I'm not sure. If you are going to use on-heap buffers, but want Kryo to allocate them for you, why don't you simply use byte arrays for this purpose? It would be also much faster. But I'm open for suggestions. If you present a convincing use-case for such an option, I could include it. |
Nice! Your fix will give user enough flexibility, so another option is not needed imo. |
Sweet. btw if you have any pointers to articles/benchmarks supporting your point about byte[] being faster than heap bytebuffers I'd love to read more about it. |
Interesting trivia, with HotSpot direct ByteBuffers become slower as soon On Thu, Jan 2, 2014 at 9:36 PM, Brian Harris [email protected]:
|
The user may construct a ByteBufferOutput with a heap buffer and expect future resizes to also create heap buffers, but today it always uses direct buffers for resize. What do you think of exposing an option for user to choose, or perhaps internally making the decision based on the type of buffer used at construction.
The text was updated successfully, but these errors were encountered: