You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Actual behavior mockgen invokes go list as subcommand with -json.
Expected behavior it would execute much faster if invoking go list with -json=ImportPath,Name
To Reproduce
Open a project with reasonably number of mockgen usage.
time the run of all mockgen executions
in mock/mockgen/mockgen.go, change the function createPackageMap
Change arguments to go list from "list", "-json" to "list", "-json=ImportPath,Name"
Background:
go list is faster if we don't request the whole information in JSON format but only the two fields we are interested in: Name and ImportPath. There are conditionals like if listJsonFields.needAny("Deps", "DepsErrors") { in go's cmd/go/internal/list/list.go which are the reason that it's faster if we request only the subset of fields.
Verified in a scenario where generating 14 mocks from protobuf interfaces, 10 test runs:
The change will result in a diff of just 1 line change. No tests are affected.
Since this project claims to be owned by uber (not sure how this plays out with the google history of the code), I'm not motivated to get involved in legal questions by signing a CLA nor do I understand why this projects needs such a CLA or want to discuss it.
I'd welcome if anyone uses these instructions to make a PR.
The text was updated successfully, but these errors were encountered:
Actual behavior mockgen invokes
go list
as subcommand with-json
.Expected behavior it would execute much faster if invoking
go list
with-json=ImportPath,Name
To Reproduce
"list", "-json"
to"list", "-json=ImportPath,Name"
Background:
go list is faster if we don't request the whole information in JSON format but only the two fields we are interested in:
Name
andImportPath
. There are conditionals likeif listJsonFields.needAny("Deps", "DepsErrors") {
in go'scmd/go/internal/list/list.go
which are the reason that it's faster if we request only the subset of fields.Verified in a scenario where generating 14 mocks from protobuf interfaces, 10 test runs:
The change will result in a diff of just 1 line change. No tests are affected.
Since this project claims to be owned by uber (not sure how this plays out with the google history of the code), I'm not motivated to get involved in legal questions by signing a CLA nor do I understand why this projects needs such a CLA or want to discuss it.
I'd welcome if anyone uses these instructions to make a PR.
The text was updated successfully, but these errors were encountered: