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

Improvement: Improve ByteBuffers performance #3718

Conversation

WojciechMazur
Copy link
Contributor

This PR continues onging effort on improving nio Buffers performance. Should allow for up to 50% faster execution (no exact benchmark data from before changes), based on debugging of 1 Billions Rows Challange in Scala Native

  • All Buffers define rawAddress which is equal to address calculated from array.at(arrayOffset) / mappedData.data + offset. The only exception is StringCharBuffer which does not expose pointer to underlying arrays. It's methods are overriden.
  • Use a common implemention of relativate and absolute get/put methods in TBuffer instead of using GenBuffers.
  • Don't use ByteArrayBits to implement getX/putX operations on ByteBuffers. Use pointer directly. Each usage of ByteArrayBits coused creation of new instance of this class. ByteArraBits are still used in BufferViews

@WojciechMazur WojciechMazur merged commit 13d059a into scala-native:main Jan 30, 2024
60 of 62 checks passed
@WojciechMazur WojciechMazur deleted the improvement/byte-buffers-performance branch January 30, 2024 02:28
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

1 participant