Skip to content

Commit 4d0eb3d

Browse files
committed
printing issues on github actions
1 parent d656d3b commit 4d0eb3d

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

codeflash/benchmarking/utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ def validate_and_format_benchmark_table(function_benchmark_timings: dict[str, di
4040
def print_benchmark_table(function_to_results: dict[str, list[tuple[BenchmarkKey, float, float, float]]]) -> None:
4141

4242
try:
43-
terminal_width = int(shutil.get_terminal_size().columns * 0.8)
43+
terminal_width = int(shutil.get_terminal_size().columns * 0.9)
4444
except Exception:
45-
terminal_width = 200 # Fallback width
45+
terminal_width = 120 # Fallback width
4646
console = Console(width = terminal_width)
4747
for func_path, sorted_tests in function_to_results.items():
4848
console.print()
@@ -52,8 +52,8 @@ def print_benchmark_table(function_to_results: dict[str, list[tuple[BenchmarkKey
5252
table = Table(title=f"Function: {function_name}", border_style="blue")
5353

5454
# Add columns - split the benchmark test into two columns
55-
table.add_column("Benchmark Module Path", style="cyan", no_wrap=True)
56-
table.add_column("Test Function", style="magenta", no_wrap=True)
55+
table.add_column("Benchmark Module Path", style="cyan", overflow="fold")
56+
table.add_column("Test Function", style="magenta", overflow="fold")
5757
table.add_column("Total Time (ms)", justify="right", style="green")
5858
table.add_column("Function Time (ms)", justify="right", style="yellow")
5959
table.add_column("Percentage (%)", justify="right", style="red")

codeflash/result/explanation.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def to_console_string(self) -> str:
5050
if self.benchmark_details:
5151
# Get terminal width (or use a reasonable default if detection fails)
5252
try:
53-
terminal_width = int(shutil.get_terminal_size().columns * 0.8)
53+
terminal_width = int(shutil.get_terminal_size().columns * 0.9)
5454
except Exception:
5555
terminal_width = 200 # Fallback width
5656

@@ -60,11 +60,11 @@ def to_console_string(self) -> str:
6060
# Add columns - split Benchmark File and Function into separate columns
6161
# Using proportional width for benchmark file column (40% of terminal width)
6262
benchmark_col_width = max(int(terminal_width * 0.4), 40)
63-
table.add_column("Benchmark Module Path", style="cyan", width=benchmark_col_width)
64-
table.add_column("Test Function", style="cyan")
65-
table.add_column("Original Runtime", style="magenta")
66-
table.add_column("Expected New Runtime", style="green")
67-
table.add_column("Speedup", style="red")
63+
table.add_column("Benchmark Module Path", style="cyan", width=benchmark_col_width, overflow="fold")
64+
table.add_column("Test Function", style="cyan", overflow="fold")
65+
table.add_column("Original Runtime", style="magenta", justify="right")
66+
table.add_column("Expected New Runtime", style="green", justify="right")
67+
table.add_column("Speedup", style="red", justify="right")
6868

6969
# Add rows with split data
7070
for detail in self.benchmark_details:

0 commit comments

Comments
 (0)