Curious to Go!

Today I started learning some fundamentals of Go. When setting up my local dev environment, I found a very peculiar anomaly in the compile time of Go programs. This was very different and I tried my best to search the WWW for a satisfying answer. I came across many discussions claiming Windows Defender as the culprit. I also tried exempting my project directory from the Windows Defender scanning, with a hope that it’ll let me run my Go programs in peace, but it didn’t ☹

Since I mostly use Git bash to write simple programs, I never felt any lags before when compling binaries of CPP. I tried again to write a simple CPP program to benchmark the build speed of Go with CPP. The results were not that good I would say!

have a look at the below screenshots,

This is CPP compile time

cpp-time

This is Go compile time

go-time

Notice the huge difference of 6s (approx)

Don’t know why, but I’ve heard some words about UNIX/POSIX being the first class citizen of Go development, thus the linker does it’s job well on Linux machines. I must also admit that windows completely follow a different approach with the file system which may also be the cause in slowing down the linker.

Let’s not get into the Linux/Windows debate 🤣

Will benchmark the same on a proper linux machine soon!

Until then signing off,

~/CR08