commit | c9529e02c1454de4e88f402df666cdccec25a744 | [log] [tgz] |
---|---|---|
author | Bobby Powers <bobbypowers@gmail.com> | Sat Apr 07 10:51:32 2012 +1000 |
committer | Rob Pike <r@golang.org> | Sat Apr 07 10:51:32 2012 +1000 |
tree | bfa7a52beb4ca94c2431a93940786ecf414a692b | |
parent | f27348776f3c898d9e5dc3c910dbac99ae482e52 [diff] |
time: in Format give buffer an initial capacity I have a small web server that simply sets several cookies along with an expires header, and then returns. In the cpuprofile for a 200k request benchmark, time.Time.Format() was showing up as 8.3% of cpu usage. Giving the buffer an inital capacity to avoid reallocs on append drops it down to 7.6%. R=golang-dev, r CC=golang-dev https://golang.org/cl/5992058