mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 13:16:42 +00:00
consensus: using testing.B.Loop
Signed-off-by: yajianggroup <yajianggroup@outlook.com>
This commit is contained in:
parent
2872242045
commit
3686c1dcd8
1 changed files with 6 additions and 6 deletions
|
|
@ -151,37 +151,37 @@ func BenchmarkDifficultyCalculator(b *testing.B) {
|
|||
}
|
||||
b.Run("big-frontier", func(b *testing.B) {
|
||||
b.ReportAllocs()
|
||||
for i := 0; i < b.N; i++ {
|
||||
for b.Loop() {
|
||||
calcDifficultyFrontier(1000014, h)
|
||||
}
|
||||
})
|
||||
b.Run("u256-frontier", func(b *testing.B) {
|
||||
b.ReportAllocs()
|
||||
for i := 0; i < b.N; i++ {
|
||||
for b.Loop() {
|
||||
CalcDifficultyFrontierU256(1000014, h)
|
||||
}
|
||||
})
|
||||
b.Run("big-homestead", func(b *testing.B) {
|
||||
b.ReportAllocs()
|
||||
for i := 0; i < b.N; i++ {
|
||||
for b.Loop() {
|
||||
calcDifficultyHomestead(1000014, h)
|
||||
}
|
||||
})
|
||||
b.Run("u256-homestead", func(b *testing.B) {
|
||||
b.ReportAllocs()
|
||||
for i := 0; i < b.N; i++ {
|
||||
for b.Loop() {
|
||||
CalcDifficultyHomesteadU256(1000014, h)
|
||||
}
|
||||
})
|
||||
b.Run("big-generic", func(b *testing.B) {
|
||||
b.ReportAllocs()
|
||||
for i := 0; i < b.N; i++ {
|
||||
for b.Loop() {
|
||||
x1(1000014, h)
|
||||
}
|
||||
})
|
||||
b.Run("u256-generic", func(b *testing.B) {
|
||||
b.ReportAllocs()
|
||||
for i := 0; i < b.N; i++ {
|
||||
for b.Loop() {
|
||||
x2(1000014, h)
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue