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

x/tools/cmd/guru: describe query is an order of magnitude slower than godef #15458

Closed
dominikh opened this issue Apr 27, 2016 · 1 comment
Closed

Comments

@dominikh
Copy link
Member

guru describe aims to replace the use of godef in editors. One major quality of godef, however, is its speed, which guru cannot match. Consider the following input file and benchmarks:

$ cat foo.go
package main

import "fmt"

func main() {
    fmt.Println()
}

$ for i in {1..10}; do time godef -i -o 52 <foo.go >/dev/null; done 
godef -i -o 52 < foo.go > /dev/null  0.02s user 0.00s system 98% cpu 0.021 total
godef -i -o 52 < foo.go > /dev/null  0.02s user 0.00s system 99% cpu 0.019 total
godef -i -o 52 < foo.go > /dev/null  0.02s user 0.00s system 99% cpu 0.018 total
godef -i -o 52 < foo.go > /dev/null  0.02s user 0.00s system 91% cpu 0.023 total
godef -i -o 52 < foo.go > /dev/null  0.01s user 0.00s system 100% cpu 0.017 total
godef -i -o 52 < foo.go > /dev/null  0.01s user 0.00s system 100% cpu 0.016 total
godef -i -o 52 < foo.go > /dev/null  0.01s user 0.00s system 99% cpu 0.015 total
godef -i -o 52 < foo.go > /dev/null  0.01s user 0.00s system 99% cpu 0.014 total
godef -i -o 52 < foo.go > /dev/null  0.01s user 0.00s system 97% cpu 0.013 total
godef -i -o 52 < foo.go > /dev/null  0.02s user 0.00s system 99% cpu 0.019 total

$ for i in {1..10}; do time guru describe foo.go:\#52 >/dev/null; done
guru describe foo.go:\#52 > /dev/null  0.77s user 0.04s system 440% cpu 0.183 total
guru describe foo.go:\#52 > /dev/null  0.56s user 0.04s system 372% cpu 0.162 total
guru describe foo.go:\#52 > /dev/null  0.58s user 0.02s system 430% cpu 0.140 total
guru describe foo.go:\#52 > /dev/null  0.61s user 0.03s system 443% cpu 0.144 total
guru describe foo.go:\#52 > /dev/null  0.56s user 0.03s system 444% cpu 0.133 total
guru describe foo.go:\#52 > /dev/null  0.61s user 0.03s system 450% cpu 0.143 total
guru describe foo.go:\#52 > /dev/null  0.57s user 0.03s system 431% cpu 0.138 total
guru describe foo.go:\#52 > /dev/null  0.66s user 0.03s system 460% cpu 0.152 total
guru describe foo.go:\#52 > /dev/null  0.56s user 0.04s system 389% cpu 0.154 total
guru describe foo.go:\#52 > /dev/null  0.56s user 0.03s system 447% cpu 0.132 total

Using guru instead of godef will incur a noticeable delay.

/cc @alandonovan

@alandonovan alandonovan self-assigned this Apr 27, 2016
@bradfitz bradfitz added this to the Unreleased milestone May 4, 2016
@alandonovan
Copy link
Contributor

@golang golang locked and limited conversation to collaborators Oct 5, 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

4 participants