Skip to content

Commit

Permalink
bench: add float bench
Browse files Browse the repository at this point in the history
  • Loading branch information
yjhmelody committed Nov 27, 2020
1 parent e629fed commit 424b8b2
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,26 @@ func BenchmarkInt32(b *testing.B) {
benchmarkEncodeDecode(b, int32(0), &dst)
}

func BenchmarkFloat32(b *testing.B) {
var dst float32
benchmarkEncodeDecode(b, float32(0), &dst)
}

func BenchmarkFloat32_Max(b *testing.B) {
var dst float32
benchmarkEncodeDecode(b, float32(math.MaxFloat32), &dst)
}

func BenchmarkFloat64(b *testing.B) {
var dst float64
benchmarkEncodeDecode(b, float64(0), &dst)
}

func BenchmarkFloat64_Max(b *testing.B) {
var dst float64
benchmarkEncodeDecode(b, float64(math.MaxFloat64), &dst)
}

func BenchmarkTime(b *testing.B) {
var dst time.Time
benchmarkEncodeDecode(b, time.Now(), &dst)
Expand Down

0 comments on commit 424b8b2

Please sign in to comment.