MCPcopy
hub / github.com/shopspring/decimal / BenchmarkNewFromFloat

Function BenchmarkNewFromFloat

decimal_bench_test.go:33–44  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

31}
32
33func BenchmarkNewFromFloat(b *testing.B) {
34 rng := rand.New(rand.NewSource(0xdead1337))
35 in := make([]float64, b.N)
36 for i := range in {
37 in[i] = rng.NormFloat64() * 10e20
38 }
39 b.ReportAllocs()
40 b.StartTimer()
41 for i := 0; i < b.N; i++ {
42 _ = NewFromFloat(in[i])
43 }
44}
45
46func BenchmarkNewFromStringFloat(b *testing.B) {
47 rng := rand.New(rand.NewSource(0xdead1337))

Callers

nothing calls this directly

Calls 1

NewFromFloatFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…