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

runtime: don't do unnecessary loads on malloc fast path #8887

Open
dvyukov opened this issue Oct 7, 2014 · 1 comment
Open

runtime: don't do unnecessary loads on malloc fast path #8887

dvyukov opened this issue Oct 7, 2014 · 1 comment
Milestone

Comments

@dvyukov
Copy link
Member

dvyukov commented Oct 7, 2014

Currently we load runtime.memstats.heap_alloc and runtime.MemProfileRate on every
malloc. Both are not strictly necessary and bring 2 unnecessary cache lines into cache.

Here are proof-of-concept CLs:
https://golang.org/cl/129810043/
https://golang.org/cl/128100043/

Ideally we trigger GC directly from mcacheRefill, but it's not trivial to implement.
@rsc
Copy link
Contributor

rsc commented Oct 7, 2014

Comment 1:

Is this causing a performance problem?

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

No branches or pull requests

2 participants