github.1485827954.workers.dev/ethereum/go-ethereum@v1.14.3/log/format_test.go (about) 1 package log 2 3 import ( 4 "math/rand" 5 "testing" 6 ) 7 8 var sink []byte 9 10 func BenchmarkPrettyInt64Logfmt(b *testing.B) { 11 buf := make([]byte, 100) 12 b.ReportAllocs() 13 for i := 0; i < b.N; i++ { 14 sink = appendInt64(buf, rand.Int63()) 15 } 16 } 17 18 func BenchmarkPrettyUint64Logfmt(b *testing.B) { 19 buf := make([]byte, 100) 20 b.ReportAllocs() 21 for i := 0; i < b.N; i++ { 22 sink = appendUint64(buf, rand.Uint64(), false) 23 } 24 }