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

Function BenchmarkDecimal_NewFromString_large_number

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

Source from the content-addressed store, hash-verified

270}
271
272func BenchmarkDecimal_NewFromString_large_number(b *testing.B) {
273 count := 72
274 prices := make([]string, 0, count)
275 for i := 1; i <= count; i++ {
276 prices = append(prices, "9323372036854775807.9223372036854775807")
277 }
278
279 b.ReportAllocs()
280 b.ResetTimer()
281 for i := 0; i < b.N; i++ {
282 for _, p := range prices {
283 d, err := NewFromString(p)
284 if err != nil {
285 b.Log(d)
286 b.Error(err)
287 }
288 }
289 }
290}
291
292func BenchmarkDecimal_ExpHullAbraham(b *testing.B) {
293 b.ResetTimer()

Callers

nothing calls this directly

Calls 1

NewFromStringFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…