Skip to content

Commit 40abec3

Browse files
correct message for optimizing all functions for raising pull requests
1 parent 7a64cd2 commit 40abec3

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

codeflash/discovery/functions_to_optimize.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
)
2626
from codeflash.code_utils.env_utils import get_pr_number
2727
from codeflash.code_utils.git_utils import get_git_diff, get_repo_owner_and_name
28-
from codeflash.code_utils.time_utils import humanize_runtime
2928
from codeflash.discovery.discover_unit_tests import discover_unit_tests
3029
from codeflash.lsp.helpers import is_LSP_enabled
3130
from codeflash.models.models import FunctionParent
@@ -244,13 +243,6 @@ def get_functions_to_optimize(
244243
)
245244

246245
logger.info(f"!lsp|Found {functions_count} function{'s' if functions_count > 1 else ''} to optimize")
247-
if optimize_all:
248-
three_min_in_ns = int(1.8e11)
249-
console.rule()
250-
logger.info(
251-
f"It might take about {humanize_runtime(functions_count * three_min_in_ns)} to fully optimize this project. Codeflash "
252-
f"will keep opening pull requests as it finds optimizations."
253-
)
254246
return filtered_modified_functions, functions_count, trace_file_path
255247

256248

codeflash/optimization/optimizer.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
create_worktree_snapshot_commit,
2323
remove_worktree,
2424
)
25+
from codeflash.code_utils.time_utils import humanize_runtime
2526
from codeflash.either import is_successful
2627
from codeflash.models.models import ValidCode
2728
from codeflash.telemetry.posthog_cf import ph
@@ -270,6 +271,16 @@ def run(self) -> None:
270271

271272
function_optimizer = None
272273
file_to_funcs_to_optimize, num_optimizable_functions, trace_file_path = self.get_optimizable_functions()
274+
if self.args.all:
275+
three_min_in_ns = int(1.8e11)
276+
console.rule()
277+
pr_message = (
278+
"\nCodeflash will keep opening pull requests as it finds optimizations." if not self.args.no_pr else ""
279+
)
280+
logger.info(
281+
f"It might take about {humanize_runtime(num_optimizable_functions * three_min_in_ns)} to fully optimize this project.{pr_message}"
282+
)
283+
273284
function_benchmark_timings, total_benchmark_timings = self.run_benchmarks(
274285
file_to_funcs_to_optimize, num_optimizable_functions
275286
)

0 commit comments

Comments
 (0)