Skip to content

Commit 7d9c4e1

Browse files
committed
Merge branch 'main' into codeflash-trace-decorator
2 parents bb9c5db + 17de10b commit 7d9c4e1

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

codeflash/optimization/function_optimizer.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ def determine_best_candidate(
377377
candidates = deque(candidates)
378378
# Start a new thread for AI service request, start loop in main thread
379379
# check if aiservice request is complete, when it is complete, append result to the candidates list
380-
with concurrent.futures.ThreadPoolExecutor(max_workers=1) as executor:
380+
with concurrent.futures.ThreadPoolExecutor(max_workers=2) as executor:
381381
future_line_profile_results = executor.submit(
382382
self.aiservice_client.optimize_python_code_line_profiler,
383383
source_code=code_context.read_writable_code,
@@ -397,8 +397,8 @@ def determine_best_candidate(
397397
if done and (future_line_profile_results is not None):
398398
line_profile_results = future_line_profile_results.result()
399399
candidates.extend(line_profile_results)
400-
original_len+= len(candidates)
401-
logger.info(f"Added results from line profiler to candidates, total candidates now: {original_len}")
400+
original_len+= len(line_profile_results)
401+
logger.info(f"Added {len(line_profile_results)} results from line profiler to candidates, total candidates now: {original_len}")
402402
future_line_profile_results = None
403403
candidate_index += 1
404404
candidate = candidates.popleft()
@@ -1126,8 +1126,8 @@ def run_and_parse_tests(
11261126
pytest_cmd=self.test_cfg.pytest_cmd,
11271127
pytest_timeout=INDIVIDUAL_TESTCASE_TIMEOUT,
11281128
pytest_target_runtime_seconds=testing_time,
1129-
pytest_min_loops=1,
1130-
pytest_max_loops=1,
1129+
pytest_min_loops=pytest_min_loops,
1130+
pytest_max_loops=pytest_min_loops,
11311131
test_framework=self.test_cfg.test_framework,
11321132
line_profiler_output_file=line_profiler_output_file,
11331133
)

codeflash/verification/test_runner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ def run_line_profile_tests(
184184
f"--timeout={pytest_timeout}",
185185
"-q",
186186
"--codeflash_loops_scope=session",
187-
f"--codeflash_min_loops={pytest_min_loops}",
188-
f"--codeflash_max_loops={pytest_max_loops}",
187+
"--codeflash_min_loops=1",
188+
"--codeflash_max_loops=1",
189189
f"--codeflash_seconds={pytest_target_runtime_seconds}",
190190
]
191191
result_file_path = get_run_tmp_file(Path("pytest_results.xml"))

0 commit comments

Comments
 (0)