On Tue, Nov 13, 2018 at 1:29 AM, Sergey Kamardin wrote:
>
> Sorry for my previous misunderstanding. Now I realized that there no
> ability in general to get the knowledge of how that slice of variadic
> arguments will be used inside hidden interface method implementation.
>
> Also, is it correct t
Hi again,
Sorry for my previous misunderstanding. Now I realized that there no
ability in general to get the knowledge of how that slice of variadic
arguments will be used inside hidden interface method implementation.
Also, is it correct to think about variadic arguments just like about
regular
Thank you for the reply.
> The optimization you are talking about is escape analysis.
I was trying to point not the escape analysis itself, but the ability of
the compiler to construct stack-based slice for the variadic arguments
instead of heap-based slices (like it does with the interfaces).
I
On Mon, Nov 12, 2018 at 4:24 AM, Sergey Kamardin wrote:
>
> Also, I may assume that this because the compiler does not knows exactly
> which function it will call in a runtime.
Most likely, yes.
> Am I understand it right and are there any plans for preparing such
> optimizations?
The optimizat
Hello gophers,
Does Go compiler has some optimizations for function and *method* calls
with `variadic` arguments? For example, this simple benchmark:
```
package main
import "testing"
func Do(xs ...int) (s int) {
for i, x := range xs {
s += i + x
}
return