all: add benchmarks to core components (#493)

Fixes #480
This commit is contained in:
Cuong Manh Le
2021-08-26 08:20:27 +00:00
committed by GitHub
parent 5eb3458d11
commit 4b11ac66c4
5 changed files with 128 additions and 2 deletions
+17
View File
@@ -0,0 +1,17 @@
package types
import (
"fmt"
"testing"
)
func BenchmarkParseChainID(b *testing.B) {
b.ReportAllocs()
// Start at 1, for valid EIP155, see regexEIP155 variable.
for i := 1; i < b.N; i++ {
chainID := fmt.Sprintf("ethermint_1-%d", i)
if _, err := ParseChainID(chainID); err != nil {
b.Fatal(err)
}
}
}