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

Optimize persistent_term:put/2 and erase/1 #2389

Merged
merged 2 commits into from
Oct 28, 2019

Conversation

sverker
Copy link
Contributor

@sverker sverker commented Sep 13, 2019

by avoiding copy the entire hash table if possible and instead write directly into the active table.

This is mostly an optimization wrt CPU and maybe memory fragmentation. The latency of both put/2 and erase/1 in a busy VM will still be significant as they have to wait for thread progress before return to guarantee read consistency without expensive memory barriers in get/1.

@sverker sverker self-assigned this Sep 13, 2019
@sverker sverker added enhancement team:VM Assigned to OTP team VM testing currently being tested, tag is used by OTP internal CI and removed testing currently being tested, tag is used by OTP internal CI labels Sep 13, 2019
@sverker sverker added the testing currently being tested, tag is used by OTP internal CI label Sep 19, 2019
@sverker sverker force-pushed the sverker/persistent_term-opt branch from 8db3b73 to 7e2b5e5 Compare October 2, 2019 16:23
by writing directly into active hash table if possible.
@sverker sverker merged commit f1329b3 into erlang:master Oct 28, 2019
@sverker sverker deleted the sverker/persistent_term-opt branch June 16, 2022 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement team:VM Assigned to OTP team VM testing currently being tested, tag is used by OTP internal CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant