• 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
..
Makefile Loading commit data...
doc.go Loading commit data...
fmt_test.go Loading commit data...
format.go Loading commit data...
print.go Loading commit data...
scan.go Loading commit data...
scan_test.go Loading commit data...
stringer_test.go Loading commit data...