J. Nick Koston
bd0705cdc0
[api] Store YAML service names in flash instead of heap
Reduces memory usage for YAML-defined API services by storing service
names and argument names as pointers to string literals in flash instead
of heap-allocated std::string objects.
Implementation:
- Created UserServiceBase<Ts...> for YAML services (const char* storage)
- Created UserServiceDynamic<Ts...> for custom_api_device (std::string storage)
- Updated CustomAPIDeviceService to inherit from UserServiceDynamic
- UserServiceTrigger uses UserServiceBase (YAML-only)
Memory savings per YAML service:
- 0 args: 32 bytes (57% reduction)
- 2 args: 48 bytes (60% reduction)
- 5 args: 96 bytes (63% reduction)
Custom API device services maintain same memory footprint (no regression).
Typical ESPHome device (2-5 services): 100-240 bytes saved
High-service device (10+ services): 400-800 bytes saved
2025-11-05 18:51:17 -06:00
..
2025-10-20 20:39:05 -10:00
2025-09-19 12:59:48 +00:00
2025-11-05 18:51:17 -06:00
2025-11-05 12:50:35 -06:00
2025-10-20 10:06:43 +13:00
2019-02-13 16:54:02 +01:00
2025-10-30 10:08:08 -05:00
2025-09-18 20:13:13 -05:00
2025-11-03 11:33:44 +11:00
2025-10-28 11:03:44 +13:00
2025-10-20 10:31:25 +13:00
2025-11-02 16:44:52 -06:00
2025-10-30 07:06:55 +13:00
2025-11-04 16:43:27 +13:00
2025-09-18 13:11:30 +12:00
2025-11-01 20:48:58 +11:00
2025-09-07 20:10:00 -05:00
2025-10-28 11:03:44 +13:00
2025-07-08 09:04:41 +12:00
2025-10-16 17:17:06 +13:00
2025-09-19 12:59:48 +00:00
2024-07-29 14:07:44 +12:00
2025-10-16 15:58:58 +13:00
2025-10-23 11:32:07 -07:00
2025-11-03 18:29:30 -06:00
2025-10-06 15:36:27 -05:00
2025-08-02 22:35:52 -10:00
2025-10-28 12:24:13 +13:00
2025-10-13 08:49:28 +13:00
2025-10-20 07:43:38 +13:00
2025-09-08 10:25:22 +12:00
2025-04-24 15:43:37 +12:00
2025-09-19 12:59:48 +00:00
2025-09-23 09:32:13 -05:00
2025-09-23 09:32:13 -05:00
2025-07-28 19:23:35 +12:00
2025-09-19 12:59:48 +00:00
2025-09-19 12:59:48 +00:00
2025-10-14 15:38:15 +13:00
2025-09-22 16:32:59 +12:00
2025-09-30 14:03:52 -04:00