LGTM. Have you filled in a CLA ?
On Thu, Apr 19, 2012 at 4:02 PM, <mchaten@gmail.com> wrote:
> Reviewers: golang-dev_googlegroups.com,
>
> Message:
> Hello golang-dev@googlegroups.com (cc: minux.ma@gmail.com),
>
> I'd like you to review this change to
> https://code.google.com/p/go/
>
>
> Description:
> runtime: add benchmark for complex128 division
>
> Please review this at http://codereview.appspot.com/6070043/
>
> Affected files:
> A src/pkg/runtime/complex_test.go
>
>
> Index: src/pkg/runtime/complex_test.go
> ===================================================================
> new file mode 100644
> --- /dev/null
> +++ b/src/pkg/runtime/complex_test.go
> @@ -0,0 +1,52 @@
> +// Copyright 2012 The Go Authors. All rights reserved.
> +// Use of this source code is governed by a BSD-style
> +// license that can be found in the LICENSE file.
> +
> +package runtime_test
> +
> +import (
> + "math/cmplx"
> + "testing"
> +)
> +
> +var result complex128
> +
> +func BenchmarkComplex128DivNormal(b *testing.B) {
> + d := 15 + 2i
> + n := 32 + 3i
> + for i := 0; i < b.N; i++ {
> + result = n / d
> + }
> +}
> +
> +func BenchmarkComplex128DivNisNaN(b *testing.B) {
> + d := cmplx.NaN()
> + n := 32 + 3i
> + for i := 0; i < b.N; i++ {
> + result = n / d
> + }
> +}
> +
> +func BenchmarkComplex128DivDisNaN(b *testing.B) {
> + d := 15 + 2i
> + n := cmplx.NaN()
> + for i := 0; i < b.N; i++ {
> + result = n / d
> + }
> +}
> +
> +func BenchmarkComplex128DivNisInf(b *testing.B) {
> + d := 15 + 2i
> + n := cmplx.Inf()
> + for i := 0; i < b.N; i++ {
> + result = n / d
> + }
> +}
> +
> +func BenchmarkComplex128DivDisInf(b *testing.B) {
> + d := cmplx.Inf()
> + n := 32 + 3i
> + for i := 0; i < b.N; i++ {
> + result = n / d
> + }
> +}
>
>
> might work a little better for avoiding optimizations.
> i bet gccgo compiles the loop away.
Thanks Russ. I made your suggested change. There was no significant change in
the benchmark results using this form.
Issue 6070043: code review 6070043: runtime: add benchmark for complex128 division
(Closed)
Created 12 years ago by chaten
Modified 12 years ago
Reviewers: dave_cheney.net
Base URL:
Comments: 0