TIL: Go not only passes all arguments via the stack on x86-64, it passes *return values* via the stack too. 
-
-
That seems about right, based on my experiments with other languages in the past (with a few pathological excursions to ~30% or more).
-
With Clay we passed all arguments indirectly but noalias to allow for polymorphic function pointers to work. It seemed like llvm did a good enough job inlining and register-promoting within modules to not make much diff in optimized builds, at least for microbenchmarks
- 2 more replies
New conversation -
-
-
I love how unapologetically 70s Go is
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
It's far worse for functions that make an initial non-tail call that consumes most or all of the arguments. Requires complete copy vs no code.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
That sounds plausible, IIRC -fomit-frame-pointer is worth a few % of perf even on register-rich CPUs like x86-64. All that stack traffic adds up.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
OTOH putting arguments in the stack probably makes a bunch of meta memory stuff like GC, unwind, etc. simpler and cheaper. (I would expect optimizing immediate calls at the expense of that other stuff is still probably the ultimately right tradeoff)
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Can you point to the discussion? I'm ok with
@_rsc 's explanation why they started with home brew for even. Bu still can't fathom why they're not moving to something like LLVM or libfirm. - End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.