mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
30
api/id/id_test.go
Normal file
30
api/id/id_test.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package id
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func BenchmarkGen(b *testing.B) {
|
||||
for i := 0; i < b.N; i++ {
|
||||
id := New()
|
||||
_ = id
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkMarshalText(b *testing.B) {
|
||||
id := New()
|
||||
for i := 0; i < b.N; i++ {
|
||||
byts, _ := id.MarshalText()
|
||||
_ = byts
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkUnmarshalText(b *testing.B) {
|
||||
id := New()
|
||||
byts, _ := id.MarshalText()
|
||||
for i := 0; i < b.N; i++ {
|
||||
var id Id
|
||||
id.UnmarshalText(byts)
|
||||
_ = id
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user