-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
dependencyDue to an issue in an external imported packageDue to an issue in an external imported packagego modulesgoimport
Description
Problem statement
Generating server code for a Go module is much slower than doing so for the non-module equivalent.
Swagger specification
Reproducible with Petstore example.
Steps to reproduce
- In a directory outside of $GOPATH, download petstore example swagger as swagger.yaml.
- From that directory, run
go mod init github.com/anything/whatever
. - Run
swagger generate server -f .\swagger.yaml --name petstore
.- Note time difference between first and last log entry timestamps.
- Create a directory at $GOPATH/src/github.com/anything/whatever/petstore and copy the swagger.yaml (only) from step 1 there.
- From that directory, run
swagger generate server -f .\swagger.yaml --name petstore
.- Note time difference between first and last log entry timestamp.
Difference for me
Step # | Measurement |
---|---|
3.i | 236 s |
5.i | 8 s |
Not that the go.mod does not at any point in the above steps list any requirements - its presence is enough to cause the substantial slowdown.
Environment
swagger version: 0.17.2
go version: x.x.x go version go1.11 windows/amd64
OS: Windows 10
The slowdown has been observed to be even worse when running under docker.
bvwells, crsdrw, koalalorenzo and mjarkk
Metadata
Metadata
Assignees
Labels
dependencyDue to an issue in an external imported packageDue to an issue in an external imported packagego modulesgoimport