First you question:
Let's assume both my JS and Go programs are written the most naive way, which is probably true. So they both need to do a lot of memory allocation, deallocation and garbage collecting. How come the Go garbage collector is so much worse?
Probably because Go is a very young programming language, where the garbage collector(GC) is more simple than compared to the GC in the JS engine, and thus requires you to think more about how you are using memory.
Doing a lot of allocation and deallocation is obviously the wrong way to use the Go programming language.
In fact that is the wrong way to to use memory like that in any kind of garbage collected language (Javascript included).
You cannot pretend that Go is a scripting language.
You just have to accept that you are running on the metal (=microprocessor), and that the Go program doesn't have a virtual machine between your program and the metal.
That requires you to think more carefully about what you are doing.
If I'm having to all that work profiling and changing my code in order to mach the speed of JS I might as well use JS in the first place.
I guess that you are not used to profile your programs.
It is common to do some profiling on compiled code, to see whether or not you can make some inexpensive (in development time) changes to get a lot of extra performance and/or a lot less memory usage.
The optimized Go program on the golang profiling web page is more than 11x times faster than the original Go program, and it uses ca. 3.7 times less memory than the original Go program.
The optimized Go program is very close to the equivalent C++ program in both speed and memory usage.
You won't get CPU and memory usage that are close to a C++ program with a scripting language .
Profiling isn't much work in my book, but I am also coming from the compiled languages, not the scripting languages.
It is about knowing your programming language - knowing what the compiler is doing under the hood.
If you continue to use the Go programming language you will at some time in the future automatically know which language constructs is the best one to use. By using that knowledge you will in return get lower memory and CPU usage compared to when you was a new user of the programming language.
You may want to let Go become older, and return to it at a later time.