mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
25 lines
377 B
Go
25 lines
377 B
Go
package vm
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/holiman/uint256"
|
|
)
|
|
|
|
func BenchmarkStackSwap(b *testing.B) {
|
|
stack := newstack()
|
|
stack.push(new(uint256.Int))
|
|
stack.push(new(uint256.Int))
|
|
|
|
b.Run("swap(1)", func(b *testing.B) {
|
|
for i := 0; i < b.N; i++ {
|
|
stack.swap(1)
|
|
}
|
|
})
|
|
|
|
b.Run("swap1()", func(b *testing.B) {
|
|
for i := 0; i < b.N; i++ {
|
|
stack.swap1()
|
|
}
|
|
})
|
|
}
|