Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: severe runtime performance regression on simple function #15254

Closed
ALTree opened this issue Apr 12, 2016 · 3 comments
Closed

cmd/compile: severe runtime performance regression on simple function #15254

ALTree opened this issue Apr 12, 2016 · 3 comments

Comments

@ALTree
Copy link
Member

ALTree commented Apr 12, 2016

$ gotip version
go version devel +8edf4cb Tue Apr 12 16:30:25 2016 +0000 linux/amd64

Code:

package p125

import "testing"

func isSquaresSum(target int) bool {
    for s := 1; s*s < target; s++ {
        sum, e := 0, s+1
        for n := s; sum < target; n++ {
            sum += n * n
            if sum == target {
                return true
            }
            e++
        }
    }
    return false
}

var r bool

func BenchmarkISS(b *testing.B) {
    for n := 0; n < b.N; n++ {
        r = isSquaresSum(1e9)
    }
}

Benchmark results vs go1.6:

name   old time/op  new time/op  delta
ISS-4  1.35ms ± 0%  1.69ms ± 0%  +25.57%  (p=0.000 n=8+7)
@ALTree ALTree changed the title cmd/compile: severe performance regression on simple function cmd/compile: severe runtime performance regression on simple function Apr 12, 2016
@randall77
Copy link
Contributor

Probably a dup of #14828. Working on it.

@randall77 randall77 self-assigned this Apr 12, 2016
@randall77 randall77 added this to the Go1.7 milestone Apr 12, 2016
@gopherbot
Copy link

CL https://golang.org/cl/22160 mentions this issue.

@ALTree
Copy link
Member Author

ALTree commented Apr 20, 2016

go1.6 vs current tip:

name   old time/op  new time/op  delta
ISS-4  1.35ms ± 2%  1.12ms ± 0%  -17.10%  (p=0.000 n=8+7)

Nice! : )

@golang golang locked and limited conversation to collaborators Apr 20, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants