Skip to content

Commit

Permalink
test: perf
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Aug 20, 2024
1 parent 9850d08 commit edb794b
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions tests/functional/geth/test_trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,13 @@ def test_call_trace_supports_debug_trace_call(geth_contract, geth_account):


@geth_process_test
def test_return_value(geth_contract, geth_account):
receipt = geth_contract.getFilledArray.transact(sender=geth_account)
def test_return_value(benchmark, geth_contract, geth_account):
receipt = benchmark.pedantic(
geth_contract.getFilledArray.transact,
kwargs={"sender": geth_account},
rounds=5,
warmup_rounds=1,
)
trace = receipt.trace
expected = [1, 2, 3] # Hardcoded in contract
assert receipt.return_value == expected
Expand All @@ -324,3 +329,9 @@ def test_return_value(geth_contract, geth_account):
# NOTE: This is very important from a performance perspective!
# (VERY IMPORTANT). We shouldn't need to enrich anything.
assert trace._enriched_calltree is None

# Seeing 0.14.
# Before https://github.com/ApeWorX/ape/pull/2225, was seeing 0.17.
# In CI, can see up to 0.4 though.
avg = benchmark.stats["mean"]
assert avg < 0.6

0 comments on commit edb794b

Please sign in to comment.