test_exp_bench_arithmetic()
Documentation for tests/benchmark/compute/instruction/test_arithmetic.py::test_exp_bench_arithmetic@ffe48572.
Generate fixtures for these test cases for Bogota with:
fill -v tests/benchmark/compute/instruction/test_arithmetic.py::test_exp_bench_arithmetic --gas-benchmark-values 1
Benchmark EXP instruction.
Source code in tests/benchmark/compute/instruction/test_arithmetic.py
| @pytest.mark.parametrize("base", [3, 5, 7, 11, 13, 136279841])
@pytest.mark.parametrize("exp", [3, 5, 7, 11, 13, 136279841])
def test_exp_bench_arithmetic(
benchmark_test: BenchmarkTestFiller, base: int, exp: int
) -> None:
"""Benchmark EXP instruction."""
tx_data = b"".join(
arg.to_bytes(32, byteorder="big") for arg in (base, exp)
)
setup = Op.CALLDATALOAD(0) + Op.CALLDATALOAD(32) + Op.DUP2 + Op.DUP2
attack_block = Op.DUP2 + Op.EXP
cleanup = Op.POP + Op.POP + Op.DUP2 + Op.DUP2
benchmark_test(
target_opcode=Op.EXP,
code_generator=JumpLoopGenerator(
setup=setup,
attack_block=attack_block,
cleanup=cleanup,
tx_kwargs={"data": tx_data},
),
)
|
Parametrized Test Cases
This test generates 36 parametrized test cases across 4 forks.