mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-16 13:00:55 +00:00
Every send moved the thread's tail (isSubmitting, latestMessageId, latestMessageDepth, and a handleContinue rebound per turn), and the memoized row context listed all of them as dependencies, so each move handed every row a new context object and re-rendered the whole thread: three commits of ~12,000 component renders on a 246-message thread, one of them inside the Enter keypress. - Keep the row context object stable; the tail values are ref-backed getters for call-time reads, and rows receive them as props that the row comparator (isSameTailRelation) only reacts to when the row enters or leaves the tail. - Fork reads the split target through a getter at click time. - HoverButtons subscribes to a boolean isSubmitting context and a stable operations context instead of the combined messages-view context; Fork and Feedback are memoized so the per-send toolbar pass stops there. - Make handleContinue referentially stable. - Cache the Intl formatters behind getMessageTimestamp per locale and clock. - Add a submit-lag benchmark (e2e/benchmarks-tree) that reports long tasks, Enter-to-row latency, a CPU profile and per-commit render reasons. |
||
|---|---|---|
| .. | ||
| flatenv.ts | ||
| payload.ts | ||
| submit-lag.perf.spec.ts | ||
| tree-render.perf.spec.ts | ||