[api] Add warm batch benchmark and bench_clear_batch friend

Add SendSensorState_Batch_Warm that pre-warms the deferred batch vector
before benchmarking to isolate steady-state cost from allocation.
This commit is contained in:
J. Nick Koston
2026-04-01 08:43:38 -10:00
parent d3f3f89c59
commit 3a4a88df29
2 changed files with 36 additions and 5 deletions
+2
View File
@@ -46,12 +46,14 @@ static_assert(MAX_MESSAGES_PER_BATCH >= MAX_INITIAL_PER_BATCH,
class APIConnection;
void bench_enable_immediate_send(APIConnection *conn); // tests/benchmarks
void bench_clear_batch(APIConnection *conn); // tests/benchmarks
class APIConnection final : public APIServerConnectionBase {
public:
friend class APIServer;
friend class ListEntitiesIterator;
friend void bench_enable_immediate_send(APIConnection *conn);
friend void bench_clear_batch(APIConnection *conn);
APIConnection(std::unique_ptr<socket::Socket> socket, APIServer *parent);
~APIConnection();