MCPcopy Create free account
hub / github.com/cockroachdb/apd / benchmarkBigIntDiv

Function benchmarkBigIntDiv

bigint_test.go:2901–2915  ·  view source on GitHub ↗
(b *testing.B, aSize, bSize int)

Source from the content-addressed store, hash-verified

2899}
2900
2901func benchmarkBigIntDiv(b *testing.B, aSize, bSize int) {
2902 var r = rand.New(rand.NewSource(1234))
2903 aa := randBigInt(r, uint(aSize))
2904 bb := randBigInt(r, uint(bSize))
2905 if aa.Cmp(bb) < 0 {
2906 aa, bb = bb, aa
2907 }
2908 x := new(BigInt)
2909 y := new(BigInt)
2910
2911 b.ResetTimer()
2912 for i := 0; i < b.N; i++ {
2913 x.DivMod(aa, bb, y)
2914 }
2915}
2916
2917func BenchmarkBigIntDiv(b *testing.B) {
2918 sizes := []int{

Callers 1

BenchmarkBigIntDivFunction · 0.85

Calls 3

randBigIntFunction · 0.85
DivModMethod · 0.80
CmpMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…