]> Cypherpunks repositories - gostls13.git/commitdiff
math/big: report allocs in BenchmarkNatMul, BenchmarkNatSqr
authorRuss Cox <rsc@golang.org>
Sun, 16 Feb 2025 17:17:10 +0000 (12:17 -0500)
committerGopher Robot <gobot@golang.org>
Thu, 27 Feb 2025 13:50:45 +0000 (05:50 -0800)
Change-Id: I112f55c0e3ee3b75e615a06b27552de164565c04
Reviewed-on: https://go-review.googlesource.com/c/go/+/650637
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Russ Cox <rsc@golang.org>

src/math/big/nat_test.go

index 4722548fa965faafc0fdd0549888a90b9d7a7528..46231f79769a1810950f8f1624f3736748e08673 100644 (file)
@@ -228,6 +228,7 @@ func benchmarkNatMul(b *testing.B, nwords int) {
        y := rndNat(nwords)
        var z nat
        b.ResetTimer()
+       b.ReportAllocs()
        for i := 0; i < b.N; i++ {
                z.mul(x, y)
        }
@@ -738,6 +739,7 @@ func benchmarkNatSqr(b *testing.B, nwords int) {
        x := rndNat(nwords)
        var z nat
        b.ResetTimer()
+       b.ReportAllocs()
        for i := 0; i < b.N; i++ {
                z.sqr(x)
        }