mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-31 19:16:29 +00:00
perf(desktop): skip the timeline rect walk while following the bottom
ThreadTimeline's scroll compute read getBoundingClientRect for every user message per scroll frame; interleaved with React's streaming style writes each read forced a full reflow — the hottest self-time frame in the multitab profile (620ms over one 5-tab run). While the viewport is pinned to the bottom the active prompt is simply the last entry, so answer from data and save the layout reads for actual scrollback.
This commit is contained in:
parent
47f0cdf3a2
commit
982a425162
1 changed files with 11 additions and 0 deletions
|
|
@ -196,6 +196,17 @@ export const ThreadTimeline: FC = () => {
|
|||
const compute = () => {
|
||||
raf = 0
|
||||
|
||||
// Pinned to the bottom (the entire streaming steady-state): the active
|
||||
// prompt is simply the last one. Skipping the walk matters — it reads a
|
||||
// rect per user message per scroll frame, and interleaved with React's
|
||||
// streaming style writes each read forces a full reflow (the single
|
||||
// hottest frame in the multitab profile).
|
||||
if (viewport.dataset.following === 'true') {
|
||||
setActiveIndex(prev => (prev === entries.length - 1 ? prev : entries.length - 1))
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
const top = viewport.getBoundingClientRect().top
|
||||
|
||||
const offsets = entries.map(entry => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue