File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -169,6 +169,10 @@ def _run_with_instrumentation(
169169 def __codspeed_root_frame__ ():
170170 fn (* args , ** kwargs )
171171
172+ if SUPPORTS_PERF_TRAMPOLINE :
173+ # Warmup CPython performance map cache
174+ __codspeed_root_frame__ ()
175+
172176 lib .zero_stats ()
173177 lib .start_instrumentation ()
174178 __codspeed_root_frame__ ()
Original file line number Diff line number Diff line change 33
44import pytest
55from conftest import (
6+ IS_PERF_TRAMPOLINE_SUPPORTED ,
67 skip_with_perf_trampoline ,
78 skip_without_perf_trampoline ,
89 skip_without_pytest_benchmark ,
@@ -118,11 +119,14 @@ def _():
118119 print()
119120 """
120121 )
122+ EXPECTED_OUTPUT_COUNT = 2 if IS_PERF_TRAMPOLINE_SUPPORTED else 1
121123 with codspeed_env ():
122124 run_result = pytester .runpytest ("--codspeed" , "-s" )
123125 print (run_result .stdout .str ())
124- assert run_result .outlines .count ("I'm noisy marked!!!" ) == 1
125- assert run_result .outlines .count ("I'm noisy fixtured!!!" ) == 1
126+ assert run_result .outlines .count ("I'm noisy marked!!!" ) == EXPECTED_OUTPUT_COUNT
127+ assert (
128+ run_result .outlines .count ("I'm noisy fixtured!!!" ) == EXPECTED_OUTPUT_COUNT
129+ )
126130
127131
128132@skip_without_valgrind
You can’t perform that action at this time.
0 commit comments