From c96b8aaf2d5034f59a7b4da06b15cedf088feb74 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 28 Oct 2025 21:41:37 -0500 Subject: [PATCH] tweak --- esphome/components/api/proto.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/esphome/components/api/proto.h b/esphome/components/api/proto.h index cc238c9c8e..802fbb8607 100644 --- a/esphome/components/api/proto.h +++ b/esphome/components/api/proto.h @@ -220,7 +220,8 @@ class ProtoWriteBuffer { void write(uint8_t value) { this->buffer_->push_back(value); } // Single implementation that all overloads delegate to - void encode_varint(uint64_t value) { + // Use aggressive optimization for this hot path even in -Os builds + __attribute__((optimize("O3"))) void encode_varint(uint64_t value) { auto buffer = this->buffer_; size_t start = buffer->size();