2 ms·
> You have to understand that the Go compiler does not look for the best optimized code, it's a balance between performance / compile speed and "debuggability".
by pcwalton 8y ago
> You have to understand that the Go compiler does not look for the best optimized code, it's a balance between performance / compile speed and "debuggability".
Passing arguments in registers doesn't help "debuggability". There is a debugging advantage to not using registers at all (though there really shouldn't be; spilling all locals to stack for -g -O0 is only necessary due to design problems in LLVM). But there's no debugging advantage to having a calling convention that spills everything on stack. If you your debugging infrastructure can handle locals in registers at all, it can easily handle arguments in registers too.