Commit Graph
14095 Commits
Author SHA1 Message Date
J. Nick Koston 3af6001cdf [api] Keep write_raw_slow_ protected to not break subclass member visibility 2026-03-29 11:17:16 -10:00
J. Nick Koston 9fd745cb09 [api] Add out-of-line write_raw_ wrappers calling write_raw_inline_
Hot paths use write_raw_inline_ (ALWAYS_INLINE fast path).
Cold paths (handshake, error handling) use write_raw_ which is
an out-of-line wrapper that calls write_raw_inline_ — same logic,
no code duplication, but the compiler won't expand the fast path
at each cold call site.
2026-03-29 11:16:33 -10:00
J. Nick Koston ad25e2ae0c [api] Add single-buffer write_raw_slow_ overload for cold paths
Cold paths (write_frame_, bad indicator) no longer need to construct
an iovec just to call the slow path. The single-buffer overload wraps
in iovec internally, keeping call sites clean and avoiding iovec
setup in the caller's stack frame.
2026-03-29 11:12:10 -10:00
J. Nick Koston 5a8e54301f [api] Call write_raw_slow_ directly from cold paths to save flash
write_frame_ (handshake) and bad indicator response are cold paths
that don't benefit from the inlined write_raw_ fast path. Calling
write_raw_slow_ directly avoids expanding the inline fast path code
at these call sites, saving ~70 bytes per site.
2026-03-29 11:10:56 -10:00
J. Nick Koston ce9bc3aaa1 [api] Use iovec path for write_frame_ to avoid inlining write_raw_ in cold handshake code 2026-03-29 11:00:42 -10:00
J. Nick Koston aee9d93671 fix 2026-03-29 10:59:41 -10:00
J. Nick Koston a1163b298e [api] Inline check_socket_write_err_ in drain_overflow (removed from header) 2026-03-29 10:49:35 -10:00
J. Nick Koston 3277683058 [api] Add missing this-> prefix on write_raw_ calls 2026-03-29 10:48:47 -10:00
J. Nick Koston 348d5f583a [api] Restructure write_raw_ for single tail call to slow path 2026-03-29 10:47:07 -10:00
J. Nick Koston ea7dc663f6 [api] Inline write_raw_ fast paths into header with single slow path
Move the happy path (overflow empty + full write succeeds) inline into
the header so it gets inlined at each call site. Both overloads share
a single out-of-line write_raw_slow_ that handles partial writes,
errors, and overflow buffering.
2026-03-29 10:45:01 -10:00
J. Nick Koston f272826274 [api] Extract enqueue_overflow_ slow path and remove dead iovcnt==1 branch
Both write_raw_ overloads now have a clean fast path (direct socket
write) and delegate to a shared noinline enqueue_overflow_ for the
rare overflow case. The multi-iovec path now always calls writev
since single-message callers use the dedicated overload.
2026-03-29 10:43:01 -10:00
J. Nick Koston 5d8f67c819 [api] Add single-buffer write_raw_ overload for single-message path
The existing write_raw_ takes iovec array + count, but single-message
writes (87-100% of traffic) always pass iovcnt=1. Adding a dedicated
overload that takes (data, len) eliminates iovec construction, the
iovcnt==1 branch, and pointer indirection on the hot path.
2026-03-29 10:42:20 -10:00
J. Nick Koston 98b7f5a571 [api] Force inline write_plaintext_header to avoid batch regression 2026-03-29 10:38:54 -10:00
J. Nick Koston 4d72acafb5 Merge branch 'api/peel-first-write-iteration' of https://github.com/esphome/esphome into api/peel-first-write-iteration
# Conflicts:
#	esphome/components/api/api_frame_helper_noise.cpp
#	esphome/components/api/api_frame_helper_plaintext.cpp
2026-03-29 10:33:24 -10:00
J. Nick Koston 481c0688ad [api] Split write_protobuf_packet into dedicated virtual for single messages
Instead of routing single messages through write_protobuf_messages and
branching internally, make write_protobuf_packet a separate virtual
override in each frame helper. The single-message path gets its own
minimal stack frame with no StaticVector allocation, and the batch
path in write_protobuf_messages has no size==1 branch — each caller
picks the right method upfront.
2026-03-29 10:32:00 -10:00
J. Nick Koston 9a89641377 [api] Add flatten attribute to batch write functions to avoid regression
The noinline attribute on the batch path prevented the compiler from
inlining callees like write_plaintext_header and encrypt_noise_message_
into the loop body, causing a 5.6% regression on batch writes. Adding
flatten forces all callees to be inlined within the batch function while
noinline still keeps its large stack frame separate from the single-message
fast path.
2026-03-29 10:23:43 -10:00
J. Nick Koston 60c6bc3e21 try another way 2026-03-29 10:23:14 -10:00
J. Nick Koston 8e0763bfc5 Merge branch 'dev' into api/peel-first-write-iteration 2026-03-29 10:19:33 -10:00
Tobias StanzelandJonathan Swoboda d9adb078aa [tm1637] Add buffer manipulation methods (#13686)
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
2026-03-29 14:41:00 -03:00
J. Nick Koston 77e47f609d Merge branch 'dev' into api/peel-first-write-iteration 2026-03-28 22:59:05 -10:00
J. Nick Koston 7a7c33fdb1 [esp32_ble_server] Fix set_value action with static data lists (#15285) 2026-03-28 15:38:06 -10:00
Jonathan Swoboda b6abfec82e [core] Fix area/device hash collision validation not running (#15259) 2026-03-27 22:22:24 -04:00
Jonathan Swoboda 47774fb644 [modbus_controller] Fix wrong enum in function_code_to_register (#15253) 2026-03-27 19:55:57 -04:00
Jonathan Swoboda 34410e92b7 [as5600] Remove dead angle/position sensor code (#15254) 2026-03-27 19:55:40 -04:00
Edward Firmoandpre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> a99f051e19 [nextion] Replace queue name string literals with short Nextion-native identifiers (#15215)
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2026-03-27 13:49:00 -10:00
Keith Burzinski f6c63c62e4 [tmp117] Code clean-up (#15260) 2026-03-27 17:59:26 -05:00
Jonathan Swoboda 76d75850a3 [sgp4x] Remove dead voc_baseline config option (#15250) 2026-03-27 17:35:12 -04:00
Jonathan Swoboda 68d9f657ad [bl0940] Fix energy reference default using wrong constant in legacy mode (#15249) 2026-03-27 21:32:37 +00:00
Jonathan Swoboda 24b8a95340 [pid] Remove unused PIDSimulator class (#15247) 2026-03-27 17:24:15 -04:00
Jonathan Swoboda d245b9f123 [sm2135] Fix copy-paste error in setup pin mode (#15248) 2026-03-27 17:24:03 -04:00
Edward Firmo a2dee21e8e [nextion] Replace std::deque queues with std::list (#15211) 2026-03-27 10:24:19 -10:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 3016cd3636 Bump github/codeql-action from 4.34.1 to 4.35.1 (#15245)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-27 09:29:08 -10:00
Jonathan Swoboda 7532e1f957 [multiple] Fix uninitialized members and error constant types (#15235) 2026-03-27 14:58:41 -04:00
Jonathan Swoboda f0db0c1054 [esp32] Add ESP-IDF 5.5.4 and 6.0.0 version mappings (#15241) 2026-03-27 14:48:08 -04:00
Jonathan Swoboda 05c15f4241 [remote_base] Fix gobox uint64_t format specifier (#15237) 2026-03-27 08:44:40 -10:00
Jonathan Swoboda 951ad91cb2 [atm90e32] Fix phase angle precision loss and remove unused member (#15238) 2026-03-27 08:39:30 -10:00
Jonathan Swoboda 53bd57f3c2 [pid] Fix inverted debug log conditions and broken smoothing formula (#15240) 2026-03-27 08:37:54 -10:00
Jonathan Swoboda 4b9467cd0c [esp32_ble_client] Fix wrong union member in OPEN_EVT handler (#15236) 2026-03-27 08:37:33 -10:00
Jonathan Swoboda 0a607b9c93 [esp32_ble_server] Fix wrong union member in STOP_EVT handler (#15239) 2026-03-27 08:36:16 -10:00
Jonathan Swoboda 810c046cc6 [multiple] Fix misc hardware register bugs (#15208) 2026-03-27 14:25:38 -04:00
J. Nick Koston 5a8d6931a8 [factory_reset] Migrate FastBootTrigger to callback automation (#15232) 2026-03-27 08:24:35 -10:00
J. Nick Koston 0d67f91fac [rf_bridge] Migrate triggers to callback automation (#15231) 2026-03-27 08:24:25 -10:00
J. Nick Koston f9d41bd36a [modbus_controller] Migrate triggers to callback automation (#15230) 2026-03-27 08:24:15 -10:00
J. Nick Koston 39509265bc [haier] Migrate triggers to callback automation (#15229) 2026-03-27 08:24:03 -10:00
J. Nick Koston 2f3c21c7c1 [ezo] Migrate triggers to callback automation (#15228) 2026-03-27 08:23:50 -10:00
J. Nick Koston d77bf23c76 [nextion] Migrate triggers to callback automation (#15227) 2026-03-27 08:23:37 -10:00
J. Nick Koston f5cd1e5e76 [ld2450] Fix flaky integration test race condition (#15226) 2026-03-27 08:23:26 -10:00
J. Nick Koston a73c67e476 [ltr501] Migrate triggers to callback automation (#15225) 2026-03-27 08:23:17 -10:00
J. Nick Koston a95f9f41fb [ltr_als_ps] Migrate triggers to callback automation (#15224) 2026-03-27 08:22:58 -10:00
J. Nick Koston 6ffb5af60c [fingerprint_grow] Migrate triggers to callback automation (#15223) 2026-03-27 08:22:47 -10:00