Descriptiontime: 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%.
Patch Set 1 #Patch Set 2 : diff -r d685ccae1668 https://go.googlecode.com/hg/ #Patch Set 3 : diff -r d685ccae1668 https://go.googlecode.com/hg/ #MessagesTotal messages: 3
|