• Rob Pike's avatar
    fmt: replace channel cache with slice. · 12ad9b43
    Rob Pike authored
    Simpler concept, and it turns a queue into a stack.
    Speeds up benchmarks noticeably.
    
    Before:
    fmt_test.BenchmarkSprintfEmpty	10000000	       282 ns/op
    fmt_test.BenchmarkSprintfString	 2000000	       910 ns/op
    fmt_test.BenchmarkSprintfInt	 5000000	       723 ns/op
    fmt_test.BenchmarkSprintfIntInt	 1000000	      1071 ns/op
    fmt_test.BenchmarkSprintfPrefixedInt	 1000000	      1108 ns/op
    fmt_test.BenchmarkScanInts	    1000	   2239510 ns/op
    fmt_test.BenchmarkScanRecursiveInt	    1000	   2365432 ns/op
    
    After:
    fmt_test.BenchmarkSprintfEmpty	10000000	       232 ns/op
    fmt_test.BenchmarkSprintfString	 2000000	       837 ns/op
    fmt_test.BenchmarkSprintfInt	 5000000	       590 ns/op
    fmt_test.BenchmarkSprintfIntInt	 2000000	       910 ns/op
    fmt_test.BenchmarkSprintfPrefixedInt	 2000000	       996 ns/op
    fmt_test.BenchmarkScanInts	    1000	   2210715 ns/op
    fmt_test.BenchmarkScanRecursiveInt	    1000	   2367800 ns/op
    
    R=rsc, r
    CC=golang-dev
    https://golang.org/cl/5151044
    12ad9b43
Name
Last commit
Last update
doc Loading commit data...
include Loading commit data...
lib Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...