Live data from Hacker News

Mid-stack inlining in the Go compiler

docs.google.com

11–20 of 76 posts

Re: Mid-stack inlining in the Go compiler

#11

The presentation redacted the stats about how this affects Google performance. I bet it saves enough CPU hours to pay the author's salary many many many times over. Good job!

Maybe? I'm under the impression that the vast majority of Google's software is not written in Golang, though.

Re: Mid-stack inlining in the Go compiler

#13
post #8

It doesnt look like this solves inlining library calls?

Go statically links to all Go libraries, and only dynamically links when interfacing with C code. (As of the last time I used it, a couple years ago; this may have changed since then.)

That doesn't really answer whether it can inline library functions. The fact that it statically links means it potentially could inline methods it finds in them but I don't think that it does currently since it appears that this inline functionality works when compiling source.

Re: Mid-stack inlining in the Go compiler

#14

The presentation redacted the stats about how this affects Google performance. I bet it saves enough CPU hours to pay the author's salary many many many times over. Good job!

Maybe? I'm under the impression that the vast majority of Google's software is not written in Golang, though.

Agreed.

Re: Mid-stack inlining in the Go compiler

#15

The presentation redacted the stats about how this affects Google performance. I bet it saves enough CPU hours to pay the author's salary many many many times over. Good job!

Maybe? I'm under the impression that the vast majority of Google's software is not written in Golang, though.

Agreed.

Re: Mid-stack inlining in the Go compiler

#16

The presentation redacted the stats about how this affects Google performance. I bet it saves enough CPU hours to pay the author's salary many many many times over. Good job!

Maybe? I'm under the impression that the vast majority of Google's software is not written in Golang, though.

But even 1% of their software being go would still see more use than most software you or I write in our lifetimes.

dl.google.com has been golang since 2013. Imagine the traffic that application gets!

https://talks.golang.org/2013/oscon-dl.slide#1

Re: Mid-stack inlining in the Go compiler

#17
post #9

In case someone else is wondering: What is being called "mid-stack inlining" here is what is generally understood by the term "inlining".

The presentation makes a distinction between mid-stack and leaf inlining, and apparently it was only done on leaf calls before because this is less confusing in backtraces.

throwawayish was downvoted, but I appreciated his and CUViper's clarification.

It's not some weird, exotic form of inlining; it's just a more complete version than Go used to have.

Re: Mid-stack inlining in the Go compiler

#18
This is absolutely fantastic work.

Since I've learned about continuation passing style (which Go channels could probably be formally transformed into), I've been convinced that there's a better way to do codegen. Better calling convention, better stack representation, better instruction architecture; I'm not yet sure - it's a nag continuously at the back of my mind, almost as though it's at the tip of my tongue. In this specific case, it must surely be possible to inline a continuation with some foreign architecture. I'd love to see some literature on the more experimental end of this stuff, if anyone has it.

Re: Mid-stack inlining in the Go compiler

#19
This is interesting work!

That said, it's a little disappointing when runtimes require custom algorithms or metadata to walk the stack and construct a stack trace. It makes it harder to build debuggers that grok the state of multiple runtimes (e.g., the Go code and the C code in the same program). This also affects runtime tracing tools like DTrace, which by construction can't rely on runtime support for help.

Re: Mid-stack inlining in the Go compiler

#20
post #18

This is absolutely fantastic work. Since I've learned about continuation passing style (which Go channels could probably be formally transformed into), I've been convinced that there's a better way to do codegen. Better calling convention, better stack representation, better instruction architecture; I'm not yet sure - it's a nag continuously at the back of my mind, almost as though it's at the tip of my tongue. In t…

Are you aware of "Compiling with Continuations?

https://www.amazon.com/Compiling-Continuations-Andrew-W-Appe...

Post reply on HN