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

Faster unsafe.Ptr.{apply, update} by skipping unnecessary GC allocations #3522

Merged
merged 1 commit into from Oct 3, 2023

Conversation

WojciechMazur
Copy link
Contributor

Reimplements Ptr appply/update methods to new create a new Ptr instance. In benchmarks made for #3521 from before rewrite of ByteArrayBits skipping GC allocations allowed to drop execution time from ~500ms to ~17ms when running in release-fast mode + lto=full

This change does also add additional def {+,-}(offset: Int): Ptr[T] methods allowing to skip unneccessary boxing of primitive int to sized numbers

@WojciechMazur WojciechMazur merged commit ee84995 into scala-native:main Oct 3, 2023
76 checks passed
@WojciechMazur WojciechMazur deleted the feature/better-ptr branch October 3, 2023 11:38
WojciechMazur added a commit to WojciechMazur/scala-native that referenced this pull request Oct 13, 2023
WojciechMazur added a commit that referenced this pull request Oct 13, 2023
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