# perf: throttle domain event processing with 100ms batch window · screen/t3code-personal

[View on GitCafe](https://git.cafe/screen/t3code-personal/commit/296eb82c312b3c36237b51870b9a87249f5c6d83)

Repository: [screen/t3code-personal](https://git.cafe/screen/t3code-personal)

Visibility: public

Requested revision: 296eb82c312b3c36237b51870b9a87249f5c6d83

Requested commit: 296eb82c312b3c36237b51870b9a87249f5c6d83

Commit: 296eb82c312b3c36237b51870b9a87249f5c6d83

Tree: d6c9a363f14b74031329ee46c179658c6e76c0c4

Author: Chukwudi Nwobodo

Committer: Julius Marminge

## Message

```
perf: throttle domain event processing with 100ms batch window

During active sessions, every domain event triggered a full
syncSnapshot (IPC fetch + state rebuild + React re-render cascade) and
sometimes a provider query invalidation. Events fire in rapid bursts
during AI turns.

Replace per-event processing with a throttle-first pattern: schedule a
flush on the first event, absorb subsequent events within a 100ms
window, then sync once. Provider query invalidation is batched via a
flag. Since syncSnapshot fetches the complete snapshot, no events are
lost by skipping intermediate syncs.

```

## Parents

- [7a377fc5e4d607a475a7d36957689562d5dcccb9](https://git.cafe/screen/t3code-personal/commit/7a377fc5e4d607a475a7d36957689562d5dcccb9?format=markdown)

[Source at this commit](https://git.cafe/screen/t3code-personal/tree/296eb82c312b3c36237b51870b9a87249f5c6d83?format=markdown)
