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

Function BenchmarkDecimal_Add_same_precision

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

Source from the content-addressed store, hash-verified

183}
184
185func BenchmarkDecimal_Add_same_precision(b *testing.B) {
186 d1 := NewFromFloat(1000.123)
187 d2 := NewFromFloat(500.123)
188
189 b.ReportAllocs()
190 b.StartTimer()
191 for i := 0; i < b.N; i++ {
192 d1.Add(d2)
193 }
194}
195
196func BenchmarkDecimal_Sub_same_precision(b *testing.B) {
197 d1 := NewFromFloat(1000.123)

Callers

nothing calls this directly

Calls 2

NewFromFloatFunction · 0.85
AddMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…