1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-14 13:55:45 +00:00

Revert "Revert "Revert "[api] Release excess buffer capacity after initial sync"""

This reverts commit e8c7f74abd.
This commit is contained in:
J. Nick Koston
2025-11-05 12:36:27 -06:00
parent e8c7f74abd
commit 8514fbcf71

View File

@@ -193,11 +193,6 @@ void APIConnection::loop() {
if (!this->deferred_batch_.empty()) { if (!this->deferred_batch_.empty()) {
this->process_batch_(); this->process_batch_();
} }
// Release excess capacity from initial entity flood
// deferred_batch_ grew up to MAX_INITIAL_PER_BATCH (24) items, now shrink to free up to ~384 bytes
this->deferred_batch_.items.shrink_to_fit();
// shared_write_buffer_ grew up to ~1.5KB during initial state, now shrink to free up to ~1.4KB
this->parent_->get_shared_buffer_ref().shrink_to_fit();
// Now that everything is sent, enable immediate sending for future state changes // Now that everything is sent, enable immediate sending for future state changes
this->flags_.should_try_send_immediately = true; this->flags_.should_try_send_immediately = true;
} }