commit | 64a35f8bf7f1d68b8373c8934a6e7e8f4265c8b0 | [log] [tgz] |
---|---|---|
author | Jonathan Amsterdam <jba@google.com> | Fri Oct 23 10:09:03 2020 -0400 |
committer | Jonathan Amsterdam <jba@google.com> | Mon Oct 26 14:38:17 2020 +0000 |
tree | 26d22a995e33f99e39d6b353215bbe65f64309cc | |
parent | a3d833fbb0b5e2321a37bb733173c226a8635f1f [diff] |
internal/godoc: define functions that use internal/godoc/codec Define Package.FastEncode and FastDecodePackage, which use the new codec. Unlike the existing codec, the new one preserves the AST exactly, so we can write a better test for it: we diff the AST before and after a round trip. I had to write something that prints the AST deterministically to make that work; calling cmp.Diff directly took a long time (I ctrl-C'd after 100 seconds), and ast.Fprint isn't deterministic because it iterates over maps (the one in ast.Scope) without sorting the keys. BenchmarkDecoding compares the decoding speed of gob and the new codec against net/http. Here are the results on my cloudtop: BenchmarkDecoding BenchmarkDecoding/gob BenchmarkDecoding/gob-8 6 182617495 ns/op BenchmarkDecoding/fast BenchmarkDecoding/fast-8 27 40283639 ns/op That is, about 40ms vs. 182ms, or a speedup of about 4.5x. I also wrote an encoding benchmark, just to make sure the differences weren't huge. The new codec is faster, but not by as much as decoding. I have yet to hook up the new encoder. That is the next CL. Change-Id: Ia29f1ec1f01e2ef4a8b9cdf9425ce3e3c24d377d Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/264857 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> Reviewed-by: Julie Qiu <julie@golang.org>
Pkg.go.dev is a website for discovering and evaluating Go packages and modules.
You can check it out at https://pkg.go.dev.
Pkg.go.dev launched in November 2019, and is currently under active development by the Go team.
Here's what we are currently working on:
Design updates: We have some design changes planned for pkg.go.dev, to address UX feedback that we have received. You can expect a more cohesive search and navigation experience coming soon. We plan to share these designs for feedback once they are ready.
Godoc.org redirect: Longer term, we are working towards redirecting godoc.org traffic to pkg.go.dev. We know that there are features available on godoc.org that users want to see on pkg.go.dev, and we want to ensure that we address these. We’ve been keeping track of issues related to redirecting godoc.org traffic on Go issue #39144. These issues will be prioritized in the next few months. We also plan to continue improving our license detection algorithm.
Search improvements: We’ll be improving our search experience based on feedback in Go issue #37810, to make it easier for users to find the dependencies they are looking for and make better decisions around which ones to import.
We encourage everyone to begin using pkg.go.dev today for all of their needs and to file feedback! You can redirect all of your requests from godoc.org to pkg.go.dev, by clicking Always use pkg.go.dev
at the top of any page on godoc.org.
If you want to report a bug or have a feature suggestion, please first check the known issues to see if your issue is already being discussed. If an issue does not already exist, feel free to file an issue.
For answers to frequently asked questions, see go.dev/about.
You can also chat with us on the #tools slack channel on the Gophers slack.
We would love your help!
Our canonical Git repository is located at go.googlesource.com/pkgsite. There is a mirror of the repository at github.com/golang/pkgsite.
To contribute, please read our contributing guide.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.