perf(factory): gate the 1 Hz dispatch loop and the plugin 10 ms ticker on demand #721

Open
opened 2026-09-25 08:50:07 +02:00 by dries · 0 comments
Owner

Follow-up from the perf report (second tier).

  • `internal/factory/native_service.go:122`: `Dispatch` every second runs `ListFactoryAttempts`, `ListFactoryMergeGateDeliveries`, `WakeFactoryRetries` (UPDATE) and `ListFactoryEpics` on the single-connection state.db even with zero epics. Fix: cache an "any open epic/attempt" flag and skip the tick when false; rely on `dispatchWake` for the transition.
  • `internal/plugins/process_connection.go:149`: a 10 ms ticker per plugin process for its lifetime. Fix: channel signalling.
  • `internal/server/plugin_conversation.go:287-309`: every 5 s a full `adapter.Session()` per linked conversation — covered by the SessionSummary ticket, listed here for the loop itself.
Follow-up from the perf report (second tier). - \`internal/factory/native_service.go:122\`: \`Dispatch\` every second runs \`ListFactoryAttempts\`, \`ListFactoryMergeGateDeliveries\`, \`WakeFactoryRetries\` (UPDATE) and \`ListFactoryEpics\` on the single-connection state.db even with zero epics. Fix: cache an "any open epic/attempt" flag and skip the tick when false; rely on \`dispatchWake\` for the transition. - \`internal/plugins/process_connection.go:149\`: a 10 ms ticker per plugin process for its lifetime. Fix: channel signalling. - \`internal/server/plugin_conversation.go:287-309\`: every 5 s a full \`adapter.Session()\` per linked conversation — covered by the SessionSummary ticket, listed here for the loop itself.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dries/ocman#721
No description provided.