@@ -180,6 +180,7 @@ def generate_comparison_table(current_data: Dict, base_data: Dict, current_branc
180180|--------------|---------|------------|-----------|-----------|"""
181181
182182 significant_changes = []
183+ new_tests = []
183184 performance_summary = []
184185
185186 for current_bench in current_benchmarks :
@@ -245,10 +246,16 @@ def generate_comparison_table(current_data: Dict, base_data: Dict, current_branc
245246 else :
246247 base_ops = 1 / base_mean # Default: single operation
247248
248- # Use per-event memory if available, otherwise use time
249+ # Use memory metrics if available, otherwise use time
250+ current_mb = current_extra .get ("total_memory_mb" )
251+ base_mb = base_extra .get ("total_memory_mb" )
249252 current_peb = current_extra .get ("per_event_bytes" )
250253 base_peb = base_extra .get ("per_event_bytes" )
251- if current_peb is not None and base_peb is not None :
254+ if current_mb is not None and base_mb is not None and current_peb is None :
255+ change_percent , emoji = calculate_change_percentage (base_mb , current_mb )
256+ base_label = f"{ base_mb :.1f} MB"
257+ current_label = f"{ current_mb :.1f} MB"
258+ elif current_peb is not None and base_peb is not None :
252259 change_percent , emoji = calculate_change_percentage (base_peb , current_peb )
253260 base_label = f"{ base_peb :.0f} B/event"
254261 current_label = f"{ current_peb :.0f} B/event"
@@ -269,7 +276,10 @@ def generate_comparison_table(current_data: Dict, base_data: Dict, current_branc
269276
270277 # Track significant changes
271278 if abs (change_percent ) > 10 :
272- is_memory = current_extra .get ("per_event_bytes" ) is not None
279+ is_memory = (
280+ current_extra .get ("per_event_bytes" ) is not None
281+ or current_extra .get ("total_memory_mb" ) is not None
282+ )
273283 if is_memory :
274284 direction = "🐌 more memory" if change_percent > 0 else "🚀 less memory"
275285 else :
@@ -295,9 +305,7 @@ def generate_comparison_table(current_data: Dict, base_data: Dict, current_branc
295305
296306 else :
297307 table += f"\n | **{ test_name } ** | `-` | `{ format_time (current_mean )} ` | **New** 🆕 | 🆕 |"
298- significant_changes .append (
299- f"- **{ test_name } **: New test 🆕 ({ format_time (current_mean )} , { format_ops (current_ops )} )"
300- )
308+ new_tests .append (f"- **{ test_name } **: { format_time (current_mean )} , { format_ops (current_ops )} " )
301309
302310 table += "\n \n </details>\n \n "
303311
@@ -323,6 +331,13 @@ def generate_comparison_table(current_data: Dict, base_data: Dict, current_branc
323331 table += f"{ change } \n "
324332 table += "\n "
325333
334+ # Add new tests section
335+ if new_tests :
336+ table += "### 🆕 New Tests\n \n "
337+ for new_test in new_tests :
338+ table += f"{ new_test } \n "
339+ table += "\n "
340+
326341 return table
327342
328343
0 commit comments