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

godef might be extremly slow in Go packages using cgo when using go/packages #103

Open
segevfiner opened this issue Dec 25, 2018 · 0 comments

Comments

@segevfiner
Copy link

segevfiner commented Dec 25, 2018

I noticed that godef is now conditionally using go/packages . I had an encountered an issue with gogetdoc that is caused by go/packages. go/packages invokes go list -compiled (golang/tools/go/packages/golist.go#L630) unconditionally, which compiles any cgo packages in the list, without any caching.

This can get prohibitively slow to the point that it made gogetdoc unusable when such packages are in the list.

Steps to reproduce

You need to have ImageMagick available. (See https://github.com/gographics/imagick)

  1. Save the following as main.go in a new go package directory:
package main

import "gopkg.in/gographics/imagick.v2/imagick"

func main() {
	imagick.Initialize()
}
  1. dep init.
  2. godef -pos main.go:#87.

I haven't yet gotten around to check if this reproduces.

godetdoc issue: zmb3/gogetdoc#47

@segevfiner segevfiner changed the title godef might be extremly slow in Go packages using cgo godef might be extremly slow in Go packages using cgo when using go/packages Dec 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant