@@ -53,7 +53,6 @@ def setup(self, trace_path: str, project_root: str) -> None:
5353 raise
5454
5555 def write_benchmark_timings (self ) -> None :
56- print ("XXX ATTEMPTING TO WRITE THE BENCHMARK TIMINGS" )
5756 if not self .benchmark_timings :
5857 return # No data to write
5958
@@ -96,7 +95,6 @@ def get_function_benchmark_timings(trace_path: Path) -> dict[str, dict[Benchmark
9695
9796 """
9897 # Initialize the result dictionary
99- print ("XXX ATTEMPTING get_function_benchmark_timings" )
10098 result = {}
10199
102100 # Connect to the SQLite database
@@ -156,7 +154,6 @@ def get_benchmark_timings(trace_path: Path) -> dict[BenchmarkKey, int]:
156154
157155 """
158156 # Initialize the result dictionary
159- print ("XXX ATTEMPTING get_benchmark_timings" )
160157 result = {}
161158 overhead_by_benchmark = {}
162159
@@ -190,7 +187,6 @@ def get_benchmark_timings(trace_path: Path) -> dict[BenchmarkKey, int]:
190187
191188 # Create the benchmark key (file::function::line)
192189 benchmark_key = BenchmarkKey (module_path = benchmark_file , function_name = benchmark_func )
193- print (f"XXX Processing benchmark: { benchmark_key } " )
194190 # Subtract overhead from total time
195191 overhead = overhead_by_benchmark .get (benchmark_key , 0 )
196192 result [benchmark_key ] = time_ns - overhead
@@ -246,11 +242,9 @@ def pytest_collection_modifyitems(config: pytest.Config, items: list[pytest.Item
246242 class Benchmark : # noqa: D106
247243 def __init__ (self , request : pytest .FixtureRequest ) -> None :
248244 self .request = request
249- print ("XXX INITIALIZING THE BENCHMARK" )
250245
251246 def __call__ (self , func , * args , ** kwargs ): # type: ignore # noqa: ANN001, ANN002, ANN003, ANN204, PGH003
252247 """Handle both direct function calls and decorator usage."""
253- print ("XXX CALLED THE BENCHMARK" )
254248 if args or kwargs :
255249 # Used as benchmark(func, *args, **kwargs)
256250 return self ._run_benchmark (func , * args , ** kwargs )
@@ -264,10 +258,10 @@ def wrapped_func(*args, **kwargs): # noqa: ANN002, ANN003, ANN202
264258
265259 def _run_benchmark (self , func , * args , ** kwargs ): # noqa: ANN001, ANN002, ANN003, ANN202
266260 """Actual benchmark implementation."""
267- print ("XXX RUNNING THE BENCHMARK!!" )
268261 benchmark_module_path = module_name_from_file_path (
269- Path (str (self .request .node .fspath )), Path (codeflash_benchmark_plugin .project_root )
262+ Path (str (self .request .node .fspath )), Path (codeflash_benchmark_plugin .project_root ), traverse_up = True
270263 )
264+
271265 benchmark_function_name = self .request .node .name
272266 line_number = int (str (sys ._getframe (2 ).f_lineno )) # 2 frames up in the call stack # noqa: SLF001
273267 # Set env vars
@@ -299,7 +293,6 @@ def benchmark(request: pytest.FixtureRequest) -> object:
299293 """Fixture to provide the benchmark functionality."""
300294 if not request .config .getoption ("--codeflash-trace" ):
301295 return None
302- print ("XXX BENCHMARK PLUGIN INITIATED" )
303296 return CodeFlashBenchmarkPlugin .Benchmark (request )
304297
305298
0 commit comments