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 8494211
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 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,8 @@ 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.
avg = benchmark.stats["mean"]
assert avg < 0.17

0 comments on commit 8494211

Please sign in to comment.