Re: [go-nuts] goimports performance degrades in go module

2018-11-10 Thread Todd Neal
I tracked this down (at least it was the source of a slow goimports for me) and put up a CL at https://go-review.googlesource.com/c/tools/+/132598/ .The issue was that it's eventually exec'ing the go command for every import in the presence of modules, which adds up quickly and also doesn't

Re: [go-nuts] goimports performance degrades in go module

2018-11-10 Thread roger peppe
I will add that I regularly see goimports with modules take many seconds to run. I'm using acmego and I sometimes end up needing to switch that off because it corrupts text seconds after a save. On Fri, 9 Nov 2018, 3:26 pm Joseph Lorenzini Hi Ian/Russ, > > I should have clarified that I was

Re: [go-nuts] goimports performance degrades in go module

2018-11-08 Thread Russ Cox
On Wed, Nov 7, 2018 at 7:43 PM Joseph Lorenzini wrote: > If have a go.mod, goimports takes 30 seconds to run. If I remove the > go.mod, then goimports takes half a second to run. Is this expected? Is > goimports trying to do something with the packages found in go.mod? Is > there a way to

Re: [go-nuts] goimports performance degrades in go module

2018-11-08 Thread 'Ian Cottrell' via golang-nuts
Hi, Could you try the module aware fork of goimports https://github.com/heschik/goimports and let us know if it works and is acceptable speed wise? We are not merging it back yet because we think it may be slower for non module users, and we want some more confidence that it is a drop in

Re: [go-nuts] goimports performance degrades in go module

2018-11-08 Thread Sameer Ajmani
+Tools team 30 seconds is much too slow for a tool that's used as a save hook. Ideally we're closer to 100ms; half a second is OK. Do we have a workaround for goimports+go.mod until the latency issues are resolved? Thanks, S On Wed, Nov 7, 2018 at 7:43 PM Joseph Lorenzini wrote: > > > Hi all,