mirror of
https://github.com/esphome/esphome.git
synced 2025-10-21 11:13:46 +01:00
tweak
This commit is contained in:
@@ -238,7 +238,7 @@ def create_detailed_breakdown_table(
|
|||||||
# Combine all components from both analyses
|
# Combine all components from both analyses
|
||||||
all_components = set(target_analysis.keys()) | set(pr_analysis.keys())
|
all_components = set(target_analysis.keys()) | set(pr_analysis.keys())
|
||||||
|
|
||||||
# Filter to components that have changed or are significant
|
# Filter to components that have changed
|
||||||
changed_components = []
|
changed_components = []
|
||||||
for comp in all_components:
|
for comp in all_components:
|
||||||
target_mem = target_analysis.get(comp, {})
|
target_mem = target_analysis.get(comp, {})
|
||||||
@@ -247,8 +247,8 @@ def create_detailed_breakdown_table(
|
|||||||
target_flash = target_mem.get("flash_total", 0)
|
target_flash = target_mem.get("flash_total", 0)
|
||||||
pr_flash = pr_mem.get("flash_total", 0)
|
pr_flash = pr_mem.get("flash_total", 0)
|
||||||
|
|
||||||
# Include if component has changed or is significant (> 1KB)
|
# Only include if component has changed
|
||||||
if target_flash != pr_flash or target_flash > 1024 or pr_flash > 1024:
|
if target_flash != pr_flash:
|
||||||
delta = pr_flash - target_flash
|
delta = pr_flash - target_flash
|
||||||
changed_components.append((comp, target_flash, pr_flash, delta))
|
changed_components.append((comp, target_flash, pr_flash, delta))
|
||||||
|
|
||||||
|
@@ -67,6 +67,7 @@ def extract_from_compile_output(
|
|||||||
|
|
||||||
# Extract build directory from ESPHome's explicit build path output
|
# Extract build directory from ESPHome's explicit build path output
|
||||||
# Look for: INFO Compiling app... Build path: /path/to/build
|
# Look for: INFO Compiling app... Build path: /path/to/build
|
||||||
|
# Note: Multiple builds reuse the same build path (each overwrites the previous)
|
||||||
build_dir = None
|
build_dir = None
|
||||||
if match := re.search(r"Build path: (.+)", output_text):
|
if match := re.search(r"Build path: (.+)", output_text):
|
||||||
build_dir = match.group(1).strip()
|
build_dir = match.group(1).strip()
|
||||||
@@ -226,6 +227,10 @@ def main() -> int:
|
|||||||
f"Found {num_builds} builds - summing memory usage across all builds",
|
f"Found {num_builds} builds - summing memory usage across all builds",
|
||||||
file=sys.stderr,
|
file=sys.stderr,
|
||||||
)
|
)
|
||||||
|
print(
|
||||||
|
"WARNING: Detailed analysis will only cover the last build",
|
||||||
|
file=sys.stderr,
|
||||||
|
)
|
||||||
|
|
||||||
print(f"Total RAM: {ram_bytes} bytes", file=sys.stderr)
|
print(f"Total RAM: {ram_bytes} bytes", file=sys.stderr)
|
||||||
print(f"Total Flash: {flash_bytes} bytes", file=sys.stderr)
|
print(f"Total Flash: {flash_bytes} bytes", file=sys.stderr)
|
||||||
@@ -235,6 +240,11 @@ def main() -> int:
|
|||||||
|
|
||||||
if detected_build_dir:
|
if detected_build_dir:
|
||||||
print(f"Detected build directory: {detected_build_dir}", file=sys.stderr)
|
print(f"Detected build directory: {detected_build_dir}", file=sys.stderr)
|
||||||
|
if num_builds > 1:
|
||||||
|
print(
|
||||||
|
f" (using last of {num_builds} builds for detailed analysis)",
|
||||||
|
file=sys.stderr,
|
||||||
|
)
|
||||||
|
|
||||||
# Write build directory to file if requested
|
# Write build directory to file if requested
|
||||||
if args.output_build_dir and build_dir:
|
if args.output_build_dir and build_dir:
|
||||||
|
Reference in New Issue
Block a user