Skip to content

Commit dcc87df

Browse files
Merge pull request #230 from codeflash-ai/fix-lineprofiler
add a sleep to reduce empty loops while waiting for line profiler results
2 parents 997be0f + 9e24c0e commit dcc87df

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

codeflash/optimization/function_optimizer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import ast
44
import concurrent.futures
55
import os
6-
import shutil
76
import subprocess
87
import time
98
import uuid
@@ -405,9 +404,10 @@ def determine_best_candidate(
405404
future_line_profile_results = None
406405
try:
407406
candidate = candidates.popleft()
408-
except IndexError as e:
407+
except IndexError:
409408
if done:
410409
break
410+
time.sleep(0.1)
411411
continue
412412
candidate_index += 1
413413
get_run_tmp_file(Path(f"test_return_values_{candidate_index}.bin")).unlink(missing_ok=True)

0 commit comments

Comments
 (0)