VictoriaMetrics/lib/logstorage/stream_id_timing_test.go
2024-09-24 18:31:38 +02:00

28 lines
372 B
Go

package logstorage
import (
"testing"
)
func BenchmarkStreamIDMarshalString(b *testing.B) {
b.ReportAllocs()
b.SetBytes(1)
sid := &streamID{
tenantID: TenantID{
AccountID: 123,
ProjectID: 456,
},
id: u128{
lo: 89,
hi: 344334,
},
}
b.RunParallel(func(pb *testing.PB) {
var b []byte
for pb.Next() {
b = sid.marshalString(b[:0])
}
})
}