commit | b6aa4feeaa46732351c3c13b07eff503491e392e | [log] [tgz] |
---|---|---|
author | Dmitri Shuralyov <dmitshur@golang.org> | Fri May 08 10:00:00 2020 -0400 |
committer | Dmitri Shuralyov <dmitshur@golang.org> | Fri May 08 15:55:40 2020 +0000 |
tree | 89b1af192429d0409c3a3e5f1869a3e2cd338f0d | |
parent | 0f95301601752b1250f2356a9a55b0491a6424cd [diff] |
[x/tour] pic: don't make a string copy when writing image Previously, the entire image was encoded into a buffer, then encoded to a base64 string, which was concatenated with another string, and written to stdout in one swoop. We can do this more efficiently by writing the PNG image to a base64 encoder directly, and using buffered I/O to batch writes to stdout into moderately-sized chunks. As an added bonus, though really the main motivation for doing this optimization now, this helps avoid triggering the golang/go#38751 issue on the Go Playground. Switch to the best compression level instead of the default, reducing encoded image size at the cost of extra computation. Playground snippets need to be transferred over the network and kept in storage, so it should be a favorable trade-off. This CL was based on CL 232177. For golang/go#38751. Change-Id: I565fe538aa15910caaff98be156ac64b0d35fff4 Co-authored-by: Alexander Rakoczy <alex@golang.org> Reviewed-on: https://go-review.googlesource.com/c/tour/+/232867 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alexander Rakoczy <alex@golang.org> X-Tour-Commit: 0608babe047def227de553b6538ed3bd6277acff
This repository holds the Go Website server code and content.
The easiest way to install is to run go get -u golang.org/x/website
. You can also manually git clone the repository to $GOPATH/src/golang.org/x/website
.
This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://golang.org/doc/contribute.html.
The main issue tracker for the time repository is located at https://github.com/golang/go/issues. Prefix your issue with “x/website:” in the subject line, so it is easy to find.