mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 13:21:37 +00:00
* p2p: using testing.B.Loop * core/state: using testing.B.Loop * eth: using testing.B.Loop * log: using testing.B.Loop * core: using testing.B.Loop * core/vm: using testing.B.Loop * core/types: using testing.B.Loop * crypto: using testing.B.Loop
24 lines
383 B
Go
24 lines
383 B
Go
package log
|
|
|
|
import (
|
|
"math/rand"
|
|
"testing"
|
|
)
|
|
|
|
var sink []byte
|
|
|
|
func BenchmarkPrettyInt64Logfmt(b *testing.B) {
|
|
buf := make([]byte, 100)
|
|
b.ReportAllocs()
|
|
for b.Loop() {
|
|
sink = appendInt64(buf, rand.Int63())
|
|
}
|
|
}
|
|
|
|
func BenchmarkPrettyUint64Logfmt(b *testing.B) {
|
|
buf := make([]byte, 100)
|
|
b.ReportAllocs()
|
|
for b.Loop() {
|
|
sink = appendUint64(buf, rand.Uint64(), false)
|
|
}
|
|
}
|