1
0
mirror of https://github.com/golang/go synced 2024-11-17 02:54:45 -07:00
The Go programming language
Go to file
Amarjeet Anand 133c0e9011 time: optimize Format for RFC3339 and RFC3339Nano
Optimise Format for the most frequently used RFC3339
and RFC3339Nano layouts by avoiding parsing of layout.

> benchstat oldBench.txt newBench.txt
name                 old time/op    new time/op    delta
FormatRFC3339-8         302ns ± 1%     203ns ± 0%  -32.89%  (p=0.016 n=5+4)
FormatRFC3339Nano-8     337ns ± 1%     219ns ± 1%  -34.91%  (p=0.008 n=5+5)

name                 old alloc/op   new alloc/op   delta
FormatRFC3339-8         32.0B ± 0%     32.0B ± 0%     ~     (all equal)
FormatRFC3339Nano-8     32.0B ± 0%     32.0B ± 0%     ~     (all equal)

name                 old allocs/op  new allocs/op  delta
FormatRFC3339-8          1.00 ± 0%      1.00 ± 0%     ~     (all equal)
FormatRFC3339Nano-8      1.00 ± 0%      1.00 ± 0%     ~     (all equal)

Fixes #54093

Change-Id: Ifc84fce6078e24514ecbcd234875bca4aaab5e0e
Reviewed-on: https://go-review.googlesource.com/c/go/+/421877
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Joseph Tsai <joetsai@digital-static.net>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
Run-TryBot: Joseph Tsai <joetsai@digital-static.net>
2022-08-11 17:14:08 +00:00
.github .github: remove duplicate security link 2022-01-07 17:55:09 +00:00
api time: add DateTime, DateOnly, and TimeOnly 2022-08-09 14:33:24 +00:00
doc doc: move Go 1.19 release notes to x/website 2022-08-01 18:07:12 +00:00
lib/time lib/time, time/tzdata: update to 2022a 2022-05-31 08:53:53 +00:00
misc test: skip -buildmode=pie tests on alpine 2022-08-09 15:13:01 +00:00
src time: optimize Format for RFC3339 and RFC3339Nano 2022-08-11 17:14:08 +00:00
test test: relax live.go for GOEXPERIMENT=unified 2022-08-10 18:52:08 +00:00
.gitattributes
.gitignore
codereview.cfg
CONTRIBUTING.md
LICENSE
PATENTS
README.md README.md: update wiki link 2022-04-26 16:21:18 +00:00
SECURITY.md SECURITY.md: replace golang.org with go.dev 2022-04-26 19:59:47 +00:00

The Go Programming Language

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

Gopher image Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.

Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.

Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.

Download and Install

Binary Distributions

Official binary distributions are available at https://go.dev/dl/.

After downloading a binary release, visit https://go.dev/doc/install for installation instructions.

Install From Source

If a binary distribution is not available for your combination of operating system and architecture, visit https://go.dev/doc/install/source for source installation instructions.

Contributing

Go is the work of thousands of contributors. We appreciate your help!

To contribute, please read the contribution guidelines at https://go.dev/doc/contribute.

Note that the Go project uses the issue tracker for bug reports and proposals only. See https://go.dev/wiki/Questions for a list of places to ask questions about the Go language.