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

Fix performance issue of MappedByteBuffers #3521

Merged

Conversation

WojciechMazur
Copy link
Contributor

Fixes #3414 which was suffering mostly due to unnecessary GC allocations.
Previously reading 32MB of data using FloatBuffer was taking ~3s in debug mode, now it's ~250ms and ~14ms in releaseMode. It now gets similar performance characteristics as on the JVM ~10-15ms

@WojciechMazur WojciechMazur merged commit adcad38 into scala-native:main Oct 3, 2023
76 checks passed
@WojciechMazur WojciechMazur deleted the perf-fix/byte-buffers branch October 3, 2023 06:33
WojciechMazur added a commit to WojciechMazur/scala-native that referenced this pull request Oct 4, 2023
* Optimize `java.nio.ByteArrayBits` to not allocate intermidiete tuples
* Hint inlining of ByteArrayBits
* Add Character.reverseBytes implementaiton
* Sync templates with code generated types in runtime.Arrays , unsafe.Size and unsigned.USize
* Handle CFuncPtr.apply when inlined
WojciechMazur added a commit to WojciechMazur/scala-native that referenced this pull request Oct 13, 2023
* Optimize `java.nio.ByteArrayBits` to not allocate intermidiete tuples
* Hint inlining of ByteArrayBits
* Add Character.reverseBytes implementaiton
* Sync templates with code generated types in runtime.Arrays , unsafe.Size and unsigned.USize
* Handle CFuncPtr.apply when inlined

(cherry picked from commit adcad38)
WojciechMazur added a commit that referenced this pull request Oct 13, 2023
* Optimize `java.nio.ByteArrayBits` to not allocate intermidiete tuples
* Hint inlining of ByteArrayBits
* Add Character.reverseBytes implementaiton
* Sync templates with code generated types in runtime.Arrays , unsafe.Size and unsigned.USize
* Handle CFuncPtr.apply when inlined

(cherry picked from commit adcad38)
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.

MappedByteBuffer FloatView is very slow
1 participant