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

runtime: sparse zeroing in mallocgc #24928

Open
josharian opened this Issue Apr 18, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@josharian
Contributor

josharian commented Apr 18, 2018

This is a performance idea; it needs experimentation to see whether it is worth it.

mallocgc accepts a flag to not zero the new allocation. It is used in a few places in the runtime where we know already that we'll entirely overwrite the new memory; #24926 contemplates having the compiler use it too.

mallocgc must however always zero the new allocation if it contains pointers; runtime uses check for pointers before asking for raw memory. However, we could change the meaning of the "don't zero" flag to mean "I'm going to overwrite all the memory". mallocgc could then decide to only zero the pointers in the new memory, instead of zeroing everything. The decision to only zero pointers might be helpful if pointers are sparse in the type. Deciding whether pointers are sparse in the type is probably something we would do at compile time and set a flag in the type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment