Files
DeepTutor/deeptutor
rncchen dfbe2878a6 perf(session): flush buffered turn events in a single transaction (#678)
Post-stream finalisation appended buffered events one at a time, each in
its own fsync'd commit (connection open + turn lookup + MAX(seq) + INSERT
+ UPDATE + COMMIT per event). On slow storage this dominates turn
finalisation: on a NAS with spinning disks each commit took ~0.65 s, so a
550-event turn kept the client spinner running for ~6 minutes after the
answer had fully streamed, because the terminal done event is only
published after the flush.

Add SQLiteSessionStore.append_turn_events, which assigns seqs and inserts
the whole batch inside one transaction (measured: 501 events in ~6 ms),
and make _flush_buffered_events prefer it, keeping the per-event path as
a fallback for stores without batch support. When the turn has vanished
(session deleted mid-drain) the flush now logs one summary line instead
of one warning per buffered event.
2026-07-24 16:09:49 +08:00
..
2026-06-11 20:03:34 +08:00
2026-07-24 03:06:58 +08:00
2026-07-18 19:47:03 +08:00
2026-04-23 19:29:16 +08:00
2026-06-17 00:56:27 +08:00
2026-05-01 13:51:45 +08:00
2026-06-27 18:47:53 +08:00
2026-07-19 16:56:34 +08:00
2026-04-23 19:29:16 +08:00
2026-07-24 03:06:58 +08:00