X7ROOT File Manager
Current Path:
/opt/golang/1.17.2/test/bench/go1
opt
/
golang
/
1.17.2
/
test
/
bench
/
go1
/
📁
..
📄
binarytree_test.go
(1.57 KB)
📄
fannkuch_test.go
(1.47 KB)
📄
fasta_test.go
(3.7 KB)
📄
fmt_test.go
(1.36 KB)
📄
go.mod
(31 B)
📄
gob_test.go
(1.75 KB)
📄
gzip_test.go
(1.01 KB)
📄
http_test.go
(949 B)
📄
json_test.go
(1.61 KB)
📄
jsondata_test.go
(115.1 KB)
📄
mandel_test.go
(848 B)
📄
parser_test.go
(888 B)
📄
parserdata_test.go
(19 KB)
📄
regexp_test.go
(1.64 KB)
📄
revcomp_test.go
(1.75 KB)
📄
template_test.go
(1.41 KB)
📄
time_test.go
(516 B)
Editing: fmt_test.go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package go1 // benchmark based on fmt/fmt_test.go import ( "bytes" "fmt" "testing" ) func BenchmarkFmtFprintfEmpty(b *testing.B) { var buf bytes.Buffer for i := 0; i < b.N; i++ { fmt.Fprintf(&buf, "") } } func BenchmarkFmtFprintfString(b *testing.B) { var buf bytes.Buffer for i := 0; i < b.N; i++ { buf.Reset() fmt.Fprintf(&buf, "%s", "hello") } } func BenchmarkFmtFprintfInt(b *testing.B) { var buf bytes.Buffer for i := 0; i < b.N; i++ { buf.Reset() fmt.Fprintf(&buf, "%d", 5) } } func BenchmarkFmtFprintfIntInt(b *testing.B) { var buf bytes.Buffer for i := 0; i < b.N; i++ { buf.Reset() fmt.Fprintf(&buf, "%d %d", 5, 6) } } func BenchmarkFmtFprintfPrefixedInt(b *testing.B) { var buf bytes.Buffer for i := 0; i < b.N; i++ { buf.Reset() fmt.Fprintf(&buf, "This is some meaningless prefix text that needs to be scanned %d", 6) } } func BenchmarkFmtFprintfFloat(b *testing.B) { var buf bytes.Buffer for i := 0; i < b.N; i++ { buf.Reset() fmt.Fprintf(&buf, "%g", 5.23184) } } func BenchmarkFmtManyArgs(b *testing.B) { var buf bytes.Buffer for i := 0; i < b.N; i++ { buf.Reset() fmt.Fprintf(&buf, "%2d/%2d/%2d %d:%d:%d %s %s\n", 3, 4, 5, 11, 12, 13, "hello", "world") } }
Upload File
Create Folder