Skip to content

Refactored weather extensions to decrease HEAP usage#374

Merged
JanPetterMG merged 4 commits intomainfrom
refactor-weather-services
Feb 23, 2026
Merged

Refactored weather extensions to decrease HEAP usage#374
JanPetterMG merged 4 commits intomainfrom
refactor-weather-services

Conversation

@JanPetterMG
Copy link
Copy Markdown
Collaborator

Refactors the weather services to reduce reliance on std::vector, replacing it with fixed-size std::array and non-owning std::span where feasible. This removes avoidable dynamic allocations and improves determinism.

Key changes

  • Replaced std::vector with std::array/std::span where possible
  • Moved weather code/condition tables toward compile-time definitions where applicable
  • Simplified parsing and lookup paths by removing heap-backed containers in hot paths

Impact

  • Fewer dynamic allocations → reduced heap fragmentation risk
  • More predictable memory/performance characteristics

@JanPetterMG JanPetterMG added firmware C++ related chore This issue or pull request is a maintenance task labels Feb 23, 2026
@JanPetterMG JanPetterMG added this to the v2.3.0 milestone Feb 23, 2026
@JanPetterMG JanPetterMG changed the title Refactor std::vector to std::array and std::span Refactored weather extensions to decrease HEAP usage Feb 23, 2026
@JanPetterMG JanPetterMG marked this pull request as ready for review February 23, 2026 22:55
@JanPetterMG JanPetterMG enabled auto-merge (squash) February 23, 2026 23:06
@JanPetterMG JanPetterMG merged commit 31ea232 into main Feb 23, 2026
152 checks passed
@JanPetterMG JanPetterMG deleted the refactor-weather-services branch February 23, 2026 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore This issue or pull request is a maintenance task firmware C++ related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant