Commit Graph

6 Commits

Author SHA1 Message Date
J. Nick Koston c09d5d783c [api] Fix immediate benchmark to set batch_delay=0
should_send_immediately_ requires both should_try_send_immediately
flag AND batch_delay==0. Without setting batch_delay to 0, all
sends were falling back to the batch path.
2026-04-01 09:00:59 -10:00
J. Nick Koston d717c7b46c [api] Use large socket buffers and remove mid-loop draining
Increase socket buffer to 16MB so benchmarks never hit WOULD_BLOCK
during an inner loop iteration. Remove per-iteration drain_socket
calls that were adding noise and causing the immediate path to
fall back to batching. Drain only between outer iterations.
2026-04-01 08:54:30 -10:00
J. Nick Koston f469a7ced2 [api] Add process_batch benchmarks for single and multi-sensor
Add ProcessBatch_SingleSensor and ProcessBatch_5Sensors benchmarks
that measure the full batch processing path: queue → process_batch_ →
dispatch → encode → frame → TCP write.
2026-04-01 08:49:33 -10:00
J. Nick Koston 3a4a88df29 [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.
2026-04-01 08:43:38 -10:00
J. Nick Koston d3f3f89c59 [api] Extract shared TCP loopback helper for API benchmarks
Deduplicate the TCP loopback socket setup between bench_plaintext_frame
and bench_send_sensor_state into a shared bench_helpers.h header.
2026-04-01 07:48:12 -10:00
J. Nick Koston dcac526a34 [api] Add send_sensor_state benchmarks
Add benchmarks for the full send_sensor_state path covering both
immediate send and batch paths. This measures the end-to-end cost
of sending a sensor state update through an APIConnection including
entity field population, proto encode, framing, and TCP write.
2026-04-01 07:42:58 -10:00