FAQ

On 2016-05-26 20:18, Martin Schnabel wrote:
i think the situation you describe may be something like this:

func BenchmarkIfaceDD(b *testing.B) {
var k K = &thinger{}
t := &thing{}
var n interface{} = 42

for i := 0; i < b.N; i++ {
k.d(t, n)
}
}

where the argument is already an interface value and does not need to
be boxed again. otherwise the optimiser can never know whether the
argument escapes, unless it does very expensive whole program analysis.
Yes... I'm pretty sure you are right about that.

That was also my conclussion after I read this:

http://www.agardner.me/golang/garbage/collection/gc/escape/analysis/2015/10/18/go-escape-analysis.html

And the linked document:

https://docs.google.com/document/d/1CxgUBPlx9iJzkz9JWkb6tIpTe5q32QDmz8l0BouG0Cw/preview

/Peter

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 6 of 7 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedMay 26, '16 at 1:06p
activeMay 27, '16 at 6:52a
posts7
users3
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase