-
Notifications
You must be signed in to change notification settings - Fork 80
Escape analysis #151
Comments
I'm sorry if I came across as being dismissive; that was not my intention. I was merely pointing out that there is more important work that needs to happen first. There are bugs in the current implementation which are being fixed before we can truly say that llgo implements the spec faithfully.
I don't think anyone disputes that escape analysis is very important to a Go implementation. It is not more important than a correct implementation, though. I would also like to note that there are things that gccgo and llgo can do that gc does not: gccgo targets additional architectures, such as POWER and Aarch64; and I have shown a proof-of-concept targeting llgo to PNaCl. So even with the limitation on performance, they do still offer realistic use cases.
I will try to be very clear: I consider escape analysis to be very important, and is something that I definitely want implemented in llgo. I have done a small amount of research into it, but have not yet started implementation. My intention is to implement it separately from llgo, on top of go/ssa, as far as practical, to enable other frontends from getting the same benefits. My spare time is increasingly limited. Any contributions in this or any other area will be very welcome. |
"...My intention is to implement it separately from llgo, on top of go/ssa, Thank you Andrew, I'm delighted this approach is still your chosen option, Elliott On Mon, Apr 21, 2014 at 3:24 PM, Andrew Wilkins [email protected]:
|
@awx Thanks so much for the hopeful reply! I would very much like to help, but I'm not familiar with go or llvm. I would be more than happy to start reading if you can forward me to some resources. Maybe I'm pushing it, but a wiki page for newbie contributors with basic pointers would also be excellent :) I'm well aware of gccgo's limited use-cases, but even under those circumstances ("we have no choice but to use gccgo"), it is unusable for a non-trivial, real-life program (unless you want to find 1024th fibonacci on PowerPC using go, which is not the usual definition of being realistically useful). No matter where you use it, gccgo is just not good enough for real-world programs yet. If I were targeting AArch64 today, I would use rather a different language than using gccgo due to serious performance problems that will come sooner or later (most likely sooner). This is why I thought it's not a valid argument, and moved on without mentioning it intentionally. |
Maybe, but my current understanding is that gc will not be based on top of go/ssa.
Choi 1999 (Escape Analysis for Java) has been recommended to me as a starting point. You will need to understand each of the SSA instructions w.r.t. capturing pointers.
This is a bit off topic, but I work on Juju which now supports POWER and Aarch64. I would call that a non-trivial, real-world application. |
There were talks for the go rewrite of gc, and these plans may include ssa package. According to that design doc, it's not definite, but go.tools/ssa is in the plans. It sounds to be the case ---this quote from Ian to GSoC student might be useful maybe?
Again, I didn't say that it's not going to work. Of course it is going to work. Juju, like any go program (trivial or non-trivial) should work. The fact that it does work has nothing to do which what I say. My point is: but at what cost? 10x the hardware? Maybe Juju guys have hardware 256GB hardware for the PowerPC, many people have to do their stuff in 512MB or 1GB. In any case, it makes to sense to waste away memory, especially that much memory. I myself tried compiling porting several of our real-life programs we use in production myself to gccgo; the results were disaster. Big programs aside, even micro-benchmarks speak of disaster. And the root of the disaster appears to be escape analysis in most cases. |
On Tue, Apr 22, 2014 at 1:28 AM, raichu [email protected] wrote:
|
Let's call it making it better step by step :) Anyway, seriously, my understanding was "may include", but I should rather have quoted the doc:
Right. As reality stands today, gccgo is not a viable option in production today for us by a huge margin. |
This came up in several before in the content of gccgo, and there seems to be plans for the upcoming GSoC 2014 (no guarantees if the student will succeed, of course).
In the mailing list, this issue was shot down on the basis that "feature-completeness trumps optimisation." But this is not "just another optimization". To put it frankly, without escape analysis, a garbage collected language like Go is not suitable for any realistic usage (other than being a "science project"). Realistic benchmarks and gccgo's wild non-adoption just proves this. And feature-completeness didn't help a bit with this (however, of course, it is essential).
In case llgo is not intended to be just another "interesting science project", and is intended as a serious alternative to gc compilers, please consider this seriously.
The text was updated successfully, but these errors were encountered: