Skip to content

Commit

Permalink
bench: Add benchmark case with max non-nested containers
Browse files Browse the repository at this point in the history
  • Loading branch information
gumb0 authored and chfast committed Mar 10, 2025
1 parent 7aee0fb commit 06f598c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/internal_benchmarks/eof_validation_bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,23 @@ const bytes max_code_sections = [] {
return eof_code_sections_1024;
}();

Check warning on line 25 in test/internal_benchmarks/eof_validation_bench.cpp

View check run for this annotation

Codecov / codecov/patch

test/internal_benchmarks/eof_validation_bench.cpp#L20-L25

Added lines #L20 - L25 were not covered by tests

const bytes max_containers = [] {
bytecode code;
for (auto i = 0; i < 256; ++i)
code += eofcreate()
.container(static_cast<uint8_t>(i))
.input(push0(), push0())
.salt(push0())
.value(push0()) +
OP_POP;
code += bytecode{OP_STOP};

Check warning on line 36 in test/internal_benchmarks/eof_validation_bench.cpp

View check run for this annotation

Codecov / codecov/patch

test/internal_benchmarks/eof_validation_bench.cpp#L27-L36

Added lines #L27 - L36 were not covered by tests

auto container = eof_bytecode(code, 4);
for (auto i = 0; i < 256; ++i)
container = container.container(eof_bytecode(OP_INVALID));
return container;
}();

Check warning on line 42 in test/internal_benchmarks/eof_validation_bench.cpp

View check run for this annotation

Codecov / codecov/patch

test/internal_benchmarks/eof_validation_bench.cpp#L38-L42

Added lines #L38 - L42 were not covered by tests

const bytes max_nested_containers = [] {
bytecode code{};
bytecode nextcode = eof_bytecode(OP_INVALID);
Expand Down Expand Up @@ -186,6 +203,8 @@ void eof_validation(benchmark::State& state, evmone::ContainerKind kind, const b
using enum evmone::ContainerKind;
BENCHMARK_CAPTURE(eof_validation, max_code_sections, runtime, max_code_sections)

Check warning on line 204 in test/internal_benchmarks/eof_validation_bench.cpp

View check run for this annotation

Codecov / codecov/patch

test/internal_benchmarks/eof_validation_bench.cpp#L204

Added line #L204 was not covered by tests
->Unit(benchmark::kMicrosecond);
BENCHMARK_CAPTURE(eof_validation, max_containers, runtime, max_containers)

Check warning on line 206 in test/internal_benchmarks/eof_validation_bench.cpp

View check run for this annotation

Codecov / codecov/patch

test/internal_benchmarks/eof_validation_bench.cpp#L206

Added line #L206 was not covered by tests
->Unit(benchmark::kMicrosecond);
BENCHMARK_CAPTURE(eof_validation, stack_height_max_span, runtime, stack_height_max_span)

Check warning on line 208 in test/internal_benchmarks/eof_validation_bench.cpp

View check run for this annotation

Codecov / codecov/patch

test/internal_benchmarks/eof_validation_bench.cpp#L208

Added line #L208 was not covered by tests
->Unit(benchmark::kMicrosecond);
BENCHMARK_CAPTURE(eof_validation, max_nested_containers, runtime, max_nested_containers)

Check warning on line 210 in test/internal_benchmarks/eof_validation_bench.cpp

View check run for this annotation

Codecov / codecov/patch

test/internal_benchmarks/eof_validation_bench.cpp#L210

Added line #L210 was not covered by tests
Expand Down

0 comments on commit 06f598c

Please sign in to comment.