TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Mid-stack inlining in the Go compiler

241 pointsby dcuabout 8 years ago

11 comments

throwawayishabout 8 years ago
In case someone else is wondering: What is being called "mid-stack inlining" here is what is generally understood by the term "inlining".
评论 #13804039 未加载
zamalekabout 8 years ago
This is absolutely fantastic work.<p>Since I&#x27;ve learned about continuation passing style (which Go channels could <i>probably</i> be formally transformed into), I&#x27;ve been convinced that there&#x27;s a better way to do codegen. Better calling convention, better stack representation, better instruction architecture; I&#x27;m not yet sure - it&#x27;s a nag continuously at the back of my mind, almost as though it&#x27;s at the tip of my tongue. In this specific case, it must <i>surely</i> be possible to inline a continuation with some foreign architecture. I&#x27;d <i>love</i> to see some literature on the more experimental end of this stuff, if anyone has it.
评论 #13804716 未加载
评论 #13806787 未加载
sheeshkebababout 8 years ago
Jvm&#x2F;java had that for a while in its JIT - it&#x27;s nice to see it to coming to Golang.<p>Byproduct of that could be little hacky things like this below that make code faster by restructuring code a little<p><a href="https:&#x2F;&#x2F;techblug.wordpress.com&#x2F;2013&#x2F;08&#x2F;19&#x2F;java-jit-compiler-inlining&#x2F;" rel="nofollow">https:&#x2F;&#x2F;techblug.wordpress.com&#x2F;2013&#x2F;08&#x2F;19&#x2F;java-jit-compiler-...</a>
chillydawgabout 8 years ago
9% faster, 15% bigger. I&#x27;ll take that!
评论 #13805035 未加载
评论 #13806014 未加载
micah_chattabout 8 years ago
What impact would that have on build times? I know a lot of work has gone into getting back to 1.4 build times, but would the added work of inlining prolong builds?
评论 #13804963 未加载
YesThatTom2about 8 years ago
The presentation redacted the stats about how this affects Google performance. I bet it saves enough CPU hours to pay the author&#x27;s salary many many many times over. Good job!
评论 #13804176 未加载
ainar-gabout 8 years ago
Whoah, nine percent? That&#x27;s a lot! Now I wonder if the improvement better or worse on non-x86 platforms?
评论 #13805013 未加载
dapabout 8 years ago
This is interesting work!<p>That said, it&#x27;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&#x27;t rely on runtime support for help.
评论 #13804813 未加载
评论 #13804754 未加载
snovv_crashabout 8 years ago
It looks like most of the improvements are in string formatting problems. I&#x27;m curious if better heuristics will help other areas as well.
cetinsertabout 8 years ago
As someone who now professionally uses go on a range of mips devices, I, for one, do care about any binary size increases!
spullaraabout 8 years ago
It doesnt look like this solves inlining library calls?
评论 #13804853 未加载
评论 #13804221 未加载