Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
runtime: don't do unnecessary loads on malloc fast path #8887
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.