With the switch to
pkg.go.dev (which in itself I quite like after getting used to it), the view-source links also changed from the
golang.org source viewer, which was fast, to
cs.opensource.google, which is rather slow.
For example, here is the code I've been looking at just now, compared to GitHub.com:
I believe GitHub is faster because it serves the code in the initial HTML response, whereas
cs.opensource.google serves a bunch of JavaScript that (after a couple of steps) loads the source. I believe the
golang.org source used the GitHub approach -- at least, it was similar speed to GitHub so I never noticed this or needed to check.
I'm located in New Zealand, so it is no doubt further away from their
origin servers than Google employees testing this stuff. (I asked a colleague from Australia, and he gets ~5s for cs.opensource, ~1s for GitHub.) I have a fast
internet connection. The tests above are in the latest Firefox under
Linux, but I've also tested using Chromium and get very similar results (on my first go in Chromium, which didn't have any cached, it was ~8s for
cs.opensource.google and ~2s for GitHub, after that it was similar to the above).
It's frustrating, because most 3rd party packages (hosted on GitHub) get the faster GitHub view-source experience, but the core stdlib gets the slow experience!
Someone has suggested moving to GitHub in this issue:
https://github.com/golang/go/issues/47202 ... however, it was more about the UI and got closed with "if you have suggestions for
cs.opensource.google, use the Send Feedback button". I submitted feedback using that button, though I doubt that'll cause anyone to do a major
rewrite of their architecture.
It seems to me that pages taking 4x as long to load is a series regression that hurts usability, at the very least outside the U.S. I use those stdlib source links a lot, and it's a bit of a killjoy to wait 4-8s each time.
I'm happy to open a new issue on this, but thought I'd see if others have input first.
-Ben