mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 11:07:40 +08:00
name old time/op new time/op delta JceWriter_WriteMap-8 4.09µs ± 3% 2.44µs ± 1% -40.39% (p=0.000 n=10+8) name old speed new speed delta JceWriter_WriteMap-8 22.8MB/s ± 3% 38.2MB/s ± 1% +67.73% (p=0.000 n=10+8) name old alloc/op new alloc/op delta JceWriter_WriteMap-8 2.34kB ± 0% 1.30kB ± 0% -44.37% (p=0.000 n=10+10) name old allocs/op new allocs/op delta JceWriter_WriteMap-8 52.0 ± 0% 30.0 ± 0% -42.31% (p=0.000 n=10+10)
17 lines
275 B
Go
17 lines
275 B
Go
package jce
|
|
|
|
import "testing"
|
|
|
|
var globalBytes []byte
|
|
|
|
func BenchmarkJceWriter_WriteMap(b *testing.B) {
|
|
var x = globalBytes
|
|
for i := 0; i < b.N; i++ {
|
|
w := NewJceWriter()
|
|
w.WriteMap(req.Map, 0)
|
|
x = w.Bytes()
|
|
}
|
|
globalBytes = x
|
|
b.SetBytes(int64(len(globalBytes)))
|
|
}
|