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

Naïve _update strategy could be suboptimal. #444

Open
dabrahams opened this issue Dec 24, 2024 · 0 comments
Open

Naïve _update strategy could be suboptimal. #444

dabrahams opened this issue Dec 24, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@dabrahams
Copy link

The problem is that withUnsafeMutableBufferPointer forces a copy if the storage is not uniquely referenced. If you are going to then rewrite/move a significant number of elements, the original copies are wasted effort, which could be bad for locality. What you really want in those cases is to construct the new buffer in its final form in-situ. This is just something to consider/benchmark as you look to further optimize. Starting with the current strategy certainly makes sense.

@dabrahams dabrahams added the bug Something isn't working label Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant