Added a benchmark for int2hexbyte

This commit is contained in:
Aliaksandr Valialkin
2015-11-30 20:05:49 +02:00
parent dd6422c56f
commit 192c5af2fa
+13
View File
@@ -6,6 +6,19 @@ import (
"testing"
)
func BenchmarkInt2HexByte(b *testing.B) {
b.RunParallel(func(pb *testing.PB) {
var i int
for pb.Next() {
i = 16
for i >= 0 {
int2hexbyte(i)
i--
}
}
})
}
func BenchmarkHexByte2Int(b *testing.B) {
buf := []byte("0123456789abcdefABCDEF")
b.RunParallel(func(pb *testing.PB) {