Hi Brian and all
I am running in Windows, to be specific:
go version go1.20.4 windows/amd64
I just found a neat way to profile `go build`, which is the debug-trace flag:
```
go build -debug-trace=build.trace .\cmd\server\GoServer.go
```
and have uploaded the results in the attachment below.
Interestingly, the trace suggests that while compilation itself (
exec.Builder.Do) is pretty fast taking 7s,
loading modules (load.PackagesAndErrors) is excruciating slow, taking 31s!
Most of the time is spent on
modfetch.download
modload.loadImport
I wonder why is module loading so slow?
Loading modules should be a pretty fast operation, as there is no internet connection involved (I can build without network).
How can we make `modfetch` and `modload` faster, or even better, eliminate them?