mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 05:06:43 +00:00
cmd: using testing.B.Loop
This commit is contained in:
parent
4414e2833f
commit
26b44a5c1e
2 changed files with 3 additions and 4 deletions
|
|
@ -880,7 +880,7 @@ func BenchmarkDecodeRLPLogs(b *testing.B) {
|
|||
b.Run("ReceiptForStorage", func(b *testing.B) {
|
||||
b.ReportAllocs()
|
||||
var r []*types.ReceiptForStorage
|
||||
for i := 0; i < b.N; i++ {
|
||||
for b.Loop() {
|
||||
if err := rlp.DecodeBytes(buf, &r); err != nil {
|
||||
b.Fatal(err)
|
||||
}
|
||||
|
|
@ -889,7 +889,7 @@ func BenchmarkDecodeRLPLogs(b *testing.B) {
|
|||
b.Run("rlpLogs", func(b *testing.B) {
|
||||
b.ReportAllocs()
|
||||
var r []*receiptLogs
|
||||
for i := 0; i < b.N; i++ {
|
||||
for b.Loop() {
|
||||
if err := rlp.DecodeBytes(buf, &r); err != nil {
|
||||
b.Fatal(err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2168,8 +2168,7 @@ func benchmarkPoolPending(b *testing.B, datacap uint64) {
|
|||
// Benchmark assembling the pending
|
||||
b.ResetTimer()
|
||||
b.ReportAllocs()
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
for b.Loop() {
|
||||
p := pool.Pending(txpool.PendingFilter{
|
||||
MinTip: uint256.NewInt(1),
|
||||
BaseFee: chain.basefee,
|
||||
|
|
|
|||
Loading…
Reference in a new issue