-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
cmd/compile: huge waste stack when make function calls #38588
Comments
Please fill out the issue template. Tell us what you did, and how you came to your conclusions. |
linux x64, go 1.14; I don't know what is the extra 80 bytes for (96bytes - 8bytes for argment - 8 bytes for return address). Maybe rbp need 8 bytes? Well, at least 60+ bytes is wasted for nothing. And 0x60 seems to be the smallest, I have seen 204 bytes being used, and in fact, there are only 5 local variables in the function, 8 bytes each. Because of this, when there are more calling frames, the stack will drain quickly and newstack will get called to expand the stack, which is much slower, because of alloc, memory copy, and update pointers...; As a result, It took 50+% of executing time of my code.
|
I see All that space makes sense to me.
We can't really make it smaller without going to a register-based calling convention (issue #18597). I'm going to close this as not actionable / working as intended. |
when make function calls, SP decrease at least 0x60 bytes even there is no use of stack at all. The stack waste forces newstack being called more frequently
The text was updated successfully, but these errors were encountered: