Assuming that it is a basic Hello World program, I don't have such problems on my Windows 11 laptop and like many Windows machines, it has antivirus, etc. running. I think it could be something specific to your machine or environment.
On Thursday, December 15, 2022 at 2:11:48 PM UTC+7 marc...@gmail.com wrote: > It can also be something to exclude the tmp directory in which Go compiles > when you do a 'go run' > (I assume you meant that when saying 'build and run') > > What happens if you just build? > - Is this slow > what happens if you just execute? > - Is this slow? > > What happens if you go install some-tool and run that? > - is that slow? > > Op woensdag 14 december 2022 om 21:03:26 UTC+1 schreef thepud...@gmail.com > : > >> Hi Declan, >> >> Virus scanners can slow things down significantly on Windows, including >> virus scanners can go into overdrive if you are touching many files, >> touching files with atypical extensions, or building and then immediately >> executing a new binary. >> >> To start, you could try temporarily disabling your virus scanner and see >> if it helps. >> >> If it does help, you might be able to benefit from finer grain changes. >> Most virus scanners support exclusion lists if you have sufficient >> privileges. You could try for example excluding (1) the directories with >> your Go code, (2) the directory shown in 'go env GOCACHE', (3) possibly the >> directory shown in 'go env GOMODCACHE', and possibly others. >> >> I would be curious to hear your results. >> >> Even if this is not the particular problem you hit, it is something other >> gophers hit, and it would be nice to document this somewhere if it isn't >> already. >> >> Separately, I thought that Rust for example would add some default >> exclusions for Windows Defender, which could be an option for the Go >> Windows installer. However, I'm not seeing that just now based on some >> quick spot checking, so maybe that's something Rust only used to do, or >> perhaps I am thinking of something else. >> >> Finally, especially if you are in a corporate environment, there can be >> other security agents, network services, proxies, and other agents that can >> interfere with development performance beyond virus scanners. >> >> Regards, >> thepudds >> >> On Wednesday, December 14, 2022 at 12:57:40 PM UTC-5 Declan Finn wrote: >> >>> Hi, >>> >>> Platform: Windows 10 >>> Go Version: 1.19.4 >>> >>> Compile and run of the most basic helloworld program is extremely slow >>> on my windows machine, taking roughly 30 seconds every time. >>> Whereas the exact same program, using the same go version, compiles and >>> runs in under 1 second on my Ubuntu machine. >>> Why is it so slow on windows? >>> I asked a collogue to do the same test on his windows machine and he >>> sees the same slowness. >>> Any help would be greatly appreciated. >>> >>> >>> -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/152ce89e-1318-4815-94aa-6b1edea38e4en%40googlegroups.com.