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: adjust _HeapAllocChunk dynamically to improve performance #16866
Comments
You're proposing a solution but barely mentioning the problem. What is your problem or motivation with this patch? |
Interesting. @toddboom, can you describe your workload, in particular how it grows/shrinks the heap over time and how much heap it uses? A GODEBUG=gctrace=1 log would be particularly concrete. Even better would be a benchmark that exhibits the improvement with this change. Rather than adding a knob, I suspect we could just adjust this dynamically. If the heap is large already, allocate more heap in larger chunks. |
@toddboom, it would also be useful to know more about the hardware where you got the 60% boost. For example, is it a large multicore? |
Ping @toddboom ? |
Given the admitted "huge desire to limit the number of user-facing variables for memory allocation and garbage collection", I think it's pretty clear we're not going to make one just for this one setting. We'd love to hear more about the bigger context here, though, and adjust it automatically in the runtime as appropriate. Thanks. |
@rsc Understood. I owe you guys some more detail on this, but I've been swamped on the product side. I'll dig in and try to provide more detail over the next few weeks. Thanks for all the feedback so far! |
Timed out in state WaitingForInfo. Closing. (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.) |
I know there is a huge desire to limit the number of user-facing variables for memory allocation and garbage collection, but through internal testing @rw found that increasing
GO_HEAP_MALLOC_MB
can give us performance gains that we can't obtain by modifyingGOGC
alone. Specifically, increasing it to 64MB from the default of 1MB gave us a ~60% boost in write throughput.I realize that opening this up for user modification might be a non-starter, but I figured I'd bring it up for discussion since the 1.8 dev cycle is kicking off. Curious to hear what you guys think about this. Let me know if you've got any questions about our use case or testing.
Here's a quick patch for the change that @rw put together:
/cc @pauldix @jwilder @rw
The text was updated successfully, but these errors were encountered: