mirror of
https://github.com/esphome/esphome.git
synced 2026-09-03 19:46:02 +00:00
Fix _Fresh benchmark consistency and address review nits
- Remove inner loop from CalcAndEncode_DeviceInfoResponse_Fresh to match SensorStateResponse_Fresh — both now measure single alloc+encode per iteration as intended for heap allocation cost benchmarking - Add comments documenting why _Fresh variants skip inner loops - Add first-wins comment to load_component_yaml_configs - Clean up .gitignore template comment
This commit is contained in:
@@ -139,6 +139,11 @@ def load_component_yaml_configs(components: list[str], tests_dir: Path) -> dict:
|
||||
Returns:
|
||||
Merged dict of component configs to add to the base config
|
||||
"""
|
||||
# Note: components are processed in sorted order. For conflicting keys
|
||||
# (e.g. two benchmark.yaml files both declaring sensor:), the first
|
||||
# component alphabetically wins via setdefault(). This is fine for now
|
||||
# with a single benchmark component (api) but would need a real merge
|
||||
# strategy if multiple components declare overlapping configs.
|
||||
merged: dict = {}
|
||||
for component in components:
|
||||
yaml_path = tests_dir / component / BENCHMARK_YAML_FILENAME
|
||||
|
||||
Reference in New Issue
Block a user