mirror of
https://github.com/valyala/fasthttp.git
synced 2026-06-14 15:56:44 +03:00
Added a benchmark for int2hexbyte
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user