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
all: static analysis to proactively free constructed garbage #5448
Comments
I really don't want to start depending on whole-program analyses for freeing garbage. I also don't want to lock us into only using allocators that support "free". We already have two classes of storage with different lifetimes: heap and stack. It's fine to figure out that something can go on the stack and to put it there, but let's not introduce a third class. Also, the linker is not involved in this example; let's keep it that way. |
It is already 2 allocs: BenchmarkAllocs 2000000 890 ns/op 1040 B/op 2 allocs/op Looks like a target for escape analysis. |
I believe that escape analysis already covers this today:
(also, wow things got faster in the interim - is that really 10x faster than the above result?) For the record, here is the salient information:
Seems the remaining allocation is the interface argument to /cc @mvdan for gardening on the issue, since I believe the issue as originally written is resolved and I don't have rights to close the issue. |
I presume your machine is just more powerful :) I agree that it does seem like the issue as written has been fixed. There already are other open issues to improve the compiler, so we can continue work elsewhere. |
TIL from a conversation on #performance on gophers slack that interface data always contains pointer, so there has to be an allocation in these circumstances, currently. Doc trail in case anyone finds themselves here: |
The text was updated successfully, but these errors were encountered: