On 2012/03/11 10:45:21, minux wrote:
> lack BenchmarkAssertE2E?
I couldn't figure out how to trigger it, any suggestions ?
>http://codereview.appspot.com/5777048/diff/6001/src/pkg/runtime/iface_test.go
> File src/pkg/runtime/iface_test.go (right):
>
>
http://codereview.appspot.com/5777048/diff/6001/src/pkg/runtime/iface_test.go...
> src/pkg/runtime/iface_test.go:70: func BenchmarkAssertI2E(b *testing.B) {
> This function doesn't bench runtime.assertI2E, but runtime.assertE2I.
Thanks, that is a duplicate, dropped.
On 2012/03/11 10:55:49, dfc wrote:
> On 2012/03/11 10:45:21, minux wrote:
> > lack BenchmarkAssertE2E?
> I couldn't figure out how to trigger it, any suggestions ?
I = I2.(interface{})
Understood.
On 13/03/2012, at 3:31, Russ Cox <rsc@golang.org> wrote:
> This is great, but not now. It's not something that is important for
> Go 1, so let's leave it until after Go 1.
>
> Thanks.
Thus we have some more time to write the remaining BenchmarkAssertI2E? :-)
On Tue, Mar 13, 2012 at 3:44 AM, Dave Cheney <dave@cheney.net> wrote:
> Understood.
>
> On 13/03/2012, at 3:31, Russ Cox <rsc@golang.org> wrote:
>
> > This is great, but not now. It's not something that is important for
> > Go 1, so let's leave it until after Go 1.
> >
> > Thanks.
>
On Mar 18, 2012 12:18 AM, "Benny Siegert" <bsiegert@gmail.com> wrote:
> On Sat, Mar 17, 2012 at 12:20, <fullung@gmail.com> wrote:
> > BenchmarkConvT2I 2000000000 0.00 ns/op
>
> How is that even possible?
It's as assignment the compiler can statically check, so the runtime code
is just a pointer assignment. I can see that being well under 1ns on a
modern computer; measurement rounding becomes significant down there.
Dave.
On Sat, Mar 17, 2012 at 10:03, David Symonds <dsymonds@golang.org> wrote:
>> On Sat, Mar 17, 2012 at 12:20, <fullung@gmail.com> wrote:
>> > BenchmarkConvT2I 2000000000 0.00 ns/op
>>
>> How is that even possible?
>
> It's as assignment the compiler can statically check, so the runtime code is
> just a pointer assignment. I can see that being well under 1ns on a modern
> computer; measurement rounding becomes significant down there.
No way is it less than 0.005 ns to do each assignment.
gccgo is surely hoisting the assignment out of the loop.
Russ
<ping /> For those interested, I have another CL, http://codereview.appspot.com/5798047/, which manually inlines the call ...
11 years, 11 months ago
(2012-04-09 00:45:26 UTC)
#18
<ping />
For those interested, I have another CL, http://codereview.appspot.com/5798047/,
which manually inlines the call to runtime·rnd which offers considerable
performance improvements for the BenchmarkConv* cases.
Please add copies of these with suffix 'Big' that use [2]*int{} as the value. Two ...
11 years, 11 months ago
(2012-04-09 19:04:48 UTC)
#19
Please add copies of these with suffix 'Big'
that use [2]*int{} as the value. Two pointers
is too big to inline, so the numbers will be
qualitatively different.
Wilco. On 10/04/2012, at 5:04, rsc@golang.org wrote: > Please add copies of these with suffix ...
11 years, 11 months ago
(2012-04-09 20:59:42 UTC)
#20
Wilco.
On 10/04/2012, at 5:04, rsc@golang.org wrote:
> Please add copies of these with suffix 'Big'
> that use [2]*int{} as the value. Two pointers
> is too big to inline, so the numbers will be
> qualitatively different.
>
>
>
> http://codereview.appspot.com/5777048/
Hi Russ, PTAL, I have added 2 cases of [2]*int{} where it made sense. Unscientific ...
11 years, 11 months ago
(2012-04-10 11:43:47 UTC)
#21
Hi Russ,
PTAL, I have added 2 cases of [2]*int{} where it made sense. Unscientific
results are
PASS
BenchmarkConvT2E 20000000 106 ns/op
BenchmarkConvT2EBig 5000000 649 ns/op
BenchmarkConvT2I 10000000 205 ns/op
BenchmarkConvI2E 50000000 30.8 ns/op
BenchmarkConvI2I 20000000 106 ns/op
BenchmarkAssertE2T 50000000 69.5 ns/op
BenchmarkAssertE2TBig 20000000 84.5 ns/op
BenchmarkAssertE2I 20000000 129 ns/op
BenchmarkAssertI2T 20000000 82.6 ns/op
BenchmarkAssertI2I 20000000 129 ns/op
BenchmarkAssertI2E 50000000 29.5 ns/op
BenchmarkAssertE2E 50000000 28.9 ns/op
ok runtime 27.770s
Where pprof says the majority of the time for BenchmarkConvT2EBig is spent in
the allocator.
Issue 5777048: code review 5777048: runtime: add interface microbenchmarks
(Closed)
Created 12 years ago by dfc
Modified 11 years, 11 months ago
Reviewers:
Base URL:
Comments: 1