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
{{ message }}
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.
After fixing problem with imports that includes the major version (#326) there are serious performance penalty.
To optimise process of getting correct packages names we can call go list command for all imports in file instead of calling it for each import independently.
Time consuming by mockgen:
Source mode
(v1.4.0)
time ../mockgen -source user.go -destination mock_user/mock_user.go Index,Embed,Embedded
../mockgen -source user.go -destination mock_user/mock_user.go 2.09s user 2.83s system 280% cpu 1.756 total
(with optimisations)
time ../mockgen -source user.go -destination mock_user/mock_user.go Index,Embed,Embedded
../mockgen -source user.go -destination mock_user/mock_user.go 0.54s user 0.63s system 320% cpu 0.364 total
Reflection mode
(v1.4.0)
time ../mockgen -destination mock_user/mock_user.go github.com/golang/mock/sample Index,Embed,Embedded
../mockgen -destination mock_user/mock_user.go Index,Embed,Embedded 1.73s user 1.72s system 199% cpu 1.731 total
(with optimisations)
time ../mockgen -destination mock_user/mock_user.go github.com/golang/mock/sample Index,Embed,Embedded
../mockgen -destination mock_user/mock_user.go github.com/golang/mock/sample 0.96s user 0.53s system 153% cpu 0.972 total
In this example with sample package performance did not dramatically changed, but with packages that has many imports it did. For example, in my project generation time for some packages may take tens of seconds vs a few seconds or even under second with optimisation.
The text was updated successfully, but these errors were encountered:
After fixing problem with imports that includes the major version (#326) there are serious performance penalty.
To optimise process of getting correct packages names we can call
go list
command for all imports in file instead of calling it for each import independently.Time consuming by mockgen:
Source mode
Reflection mode
In this example with sample package performance did not dramatically changed, but with packages that has many imports it did. For example, in my project generation time for some packages may take tens of seconds vs a few seconds or even under second with optimisation.
The text was updated successfully, but these errors were encountered: