Skip to content

Commit 9d005b1

Browse files
committed
implement suggestions
1 parent 902a982 commit 9d005b1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

codeflash/benchmarking/function_ranker.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,10 @@ def rank_functions(self, functions_to_optimize: list[FunctionToOptimize]) -> lis
128128
total_program_time = sum(
129129
s["own_time_ns"]
130130
for s in self._function_stats.values()
131-
if s.get("own_time_ns", 0) > 0 and any(target_file in s["filename"] for target_file in target_files)
131+
if s.get("own_time_ns", 0) > 0 and any(
132+
str(s.get("filename", "")).endswith("/" + target_file) or s.get("filename") == target_file
133+
for target_file in target_files
134+
)
132135
)
133136
logger.debug(
134137
f"Using file-relative importance for {len(target_files)} file(s): {target_files}. "
@@ -160,7 +163,6 @@ def rank_functions(self, functions_to_optimize: list[FunctionToOptimize]) -> lis
160163
f"Filtered down to {len(functions_to_rank)} important functions "
161164
f"from {len(functions_to_optimize)} total functions"
162165
)
163-
console.rule()
164166

165167
ranked = sorted(functions_to_rank, key=self.get_function_ttx_score, reverse=True)
166168
logger.debug(

0 commit comments

Comments
 (0)