Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- chore: update benchmark tests to use testing.B.Loop for improved performance ([filecoin-project/lotus#13385](https://github.com/filecoin-project/lotus/pull/13385))
- fix(eth): properly return vm error in all gas estimation methods ([filecoin-project/lotus#13389](https://github.com/filecoin-project/lotus/pull/13389))
- chore: all actor cmd support --actor ([filecoin-project/lotus#13391](https://github.com/filecoin-project/lotus/pull/13391))
- chore: use testing.B.Loop for improved performance ([filecoin-project/lotus#13396](https://github.com/filecoin-project/lotus/pull/13396))
Comment thread
JacksonEi marked this conversation as resolved.
Outdated

# Node and Miner v1.34.1 / 2025-09-15

Expand Down
16 changes: 8 additions & 8 deletions chain/state/statetree_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ func BenchmarkStateTreeSet(b *testing.B) {
b.ResetTimer()
b.ReportAllocs()

for i := 0; i < b.N; i++ {
a, err := address.NewIDAddress(uint64(i))
for b.Loop() {
a, err := address.NewIDAddress(uint64(b.N))
if err != nil {
b.Fatal(err)
}
err = st.SetActor(a, &types.Actor{
Balance: types.NewInt(1258812523),
Code: builtin2.StorageMinerActorCodeID,
Head: builtin2.AccountActorCodeID,
Nonce: uint64(i),
Nonce: uint64(b.N),
})
if err != nil {
b.Fatal(err)
Expand All @@ -58,16 +58,16 @@ func BenchmarkStateTreeSetFlush(b *testing.B) {
b.ResetTimer()
b.ReportAllocs()

for i := 0; i < b.N; i++ {
a, err := address.NewIDAddress(uint64(i))
for b.Loop() {
a, err := address.NewIDAddress(uint64(b.N))
if err != nil {
b.Fatal(err)
}
err = st.SetActor(a, &types.Actor{
Balance: types.NewInt(1258812523),
Code: builtin2.StorageMinerActorCodeID,
Head: builtin2.AccountActorCodeID,
Nonce: uint64(i),
Nonce: uint64(b.N),
})
if err != nil {
b.Fatal(err)
Expand Down Expand Up @@ -214,8 +214,8 @@ func BenchmarkStateTree10kGetActor(b *testing.B) {
b.ResetTimer()
b.ReportAllocs()

for i := 0; i < b.N; i++ {
a, err := address.NewIDAddress(uint64(i % 10000))
for b.Loop() {
a, err := address.NewIDAddress(uint64(b.N % 10000))
if err != nil {
b.Fatal(err)
}
Expand Down
4 changes: 2 additions & 2 deletions chain/types/electionproof_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ func BenchmarkWinCounts(b *testing.B) {

b.ResetTimer()
b.ReportAllocs()
for i := 0; i < b.N; i++ {
ep.VRFProof = []byte{byte(i), byte(i >> 8), byte(i >> 16), byte(i >> 24), byte(i >> 32)}
for b.Loop() {
ep.VRFProof = []byte{byte(b.N), byte(b.N >> 8), byte(b.N >> 16), byte(b.N >> 24), byte(b.N >> 32)}
j := ep.ComputeWinCount(power, totalPower)
res += j
}
Expand Down