Skip to content

Array.insertM: Remove write operation #359

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

Merged
merged 1 commit into from
Mar 2, 2022

Conversation

sjakobi
Copy link
Member

@sjakobi sjakobi commented Mar 2, 2022

…by initializing the array with the inserted element.


TODO:

  • Check benchmarks

…by initializing the array with the inserted element.
@treeowl
Copy link
Collaborator

treeowl commented Mar 2, 2022

Yes, this looks better.

@sjakobi
Copy link
Member Author

sjakobi commented Mar 2, 2022

According to the Core diff, this change mostly affects the union variants and some of the special inserts.

In the benchmarks it's pretty hard to detect significant changes in the noise, but it seems that I'm getting a speedup around 2% in All.HashMap.alterFInsert.ByteString and about 1% in All.HashMap.union.

@sjakobi sjakobi marked this pull request as ready for review March 2, 2022 20:59
@sjakobi sjakobi merged commit 5c57564 into master Mar 2, 2022
@sjakobi sjakobi deleted the sjakobi/optimize-array-insert branch March 2, 2022 21:02
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.

2 participants