You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: codeflash/api/aiservice.py
+7-11Lines changed: 7 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -544,7 +544,8 @@ def get_optimization_impact(
544
544
replay_tests: str,
545
545
root_dir: Path,
546
546
concolic_tests: str, # noqa: ARG002
547
-
) ->str:
547
+
calling_fn_details: str,
548
+
) ->tuple[str, str]:
548
549
"""Compute the optimization impact of current Pull Request.
549
550
550
551
Args:
@@ -558,6 +559,7 @@ def get_optimization_impact(
558
559
replay_tests: str -> replay test table
559
560
root_dir: Path -> path of git directory
560
561
concolic_tests: str -> concolic_tests (not used)
562
+
calling_fn_details: str -> filenames and definitions of functions which call the function_to_optimize
561
563
562
564
Returns:
563
565
-------
@@ -577,13 +579,6 @@ def get_optimization_impact(
577
579
]
578
580
)
579
581
code_diff=f"```diff\n{diff_str}\n```"
580
-
# TODO get complexity metrics and fn call heuristics -> constructing a complete static call graph can be expensive for really large repos
581
-
# grep function name in codebase -> ast parser to get no of calls and no of calls in loop -> radon lib to get complexity metrics -> send as additional context to the AI service
582
-
# metric 1 -> call count - how many times the function is called in the codebase
583
-
# metric 2 -> loop call count - how many times the function is called in a loop in the codebase
584
-
# metric 3 -> presence of decorators like @profile, @cache -> this means the owner of the repo cares about the performance of this function
0 commit comments