From 1fce2918fb2d82fee74d1e0641aebc75eda78e51 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 5 Nov 2025 12:22:13 -0600 Subject: [PATCH] Revert "[api] Release excess buffer capacity after initial sync" This reverts commit 90e4d15fd96b120010bed005e40ac53cc488c9f9. --- esphome/components/api/api_connection.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/esphome/components/api/api_connection.cpp b/esphome/components/api/api_connection.cpp index 47dc829b64..5ab8a6eb05 100644 --- a/esphome/components/api/api_connection.cpp +++ b/esphome/components/api/api_connection.cpp @@ -193,11 +193,6 @@ void APIConnection::loop() { if (!this->deferred_batch_.empty()) { 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 this->flags_.should_try_send_immediately = true; }