• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

humanspeak / svelte-virtual-chat / 25116581459
97%
main: 98%

Build:
Build:
LAST BUILD BRANCH: chore/perf-bench-cascade-and-heap
DEFAULT BRANCH: main
Ran 29 Apr 2026 03:07PM UTC
Jobs 1
Files 2
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

29 Apr 2026 03:00PM UTC coverage: 97.425%. First build
25116581459

push

github

web-flow
perf(virtual-chat): memoize rendered slice by visible range (#16)

* perf(virtual-chat): memoize rendered slice by visible range

Replaces `messages.slice(visibleRange.start, visibleRange.end + 1)`
with a memoized `$derived.by` that returns the cached array reference
when both bounds are unchanged AND the head/tail still point at the
same message instances. At 60fps that drops a throwaway array per
frame on smooth scroll (the common case where scroll moves within a
single message's height window), and lets Svelte's keyed each block
short-circuit when the array reference is identical to the previous
derivation.

The head/tail identity check covers the chat semantics this component
supports: append (tail changes), prepend (visibleRange recomputes,
start/end change), whole-array replace (head/tail change), and
streaming (same array reference, same elements). Mid-array
replacement with unchanged head/tail isn't covered — it isn't part
of the supported semantics, and a full slice walk would defeat the
optimization.

The perf-bench fixture's `mutations10s` doesn't move on this change
because that metric is dominated by the per-frame `transform: translateY()`
mutation on the messages container, not by message-row add/remove or
slice churn. The win here is in JS execution time and GC pressure
(no allocation per scroll frame) plus Svelte's keyed-each fast path,
which the current bench doesn't measure directly.

Validation: all 56 unit tests pass, all 360 Playwright e2e tests pass
(append, prepend, streaming, bulk, history, header-footer, scroll-away,
genai-like). Type check + ESLint clean.

Refs humanspeak/svelte-virtual-chat#10

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(virtual-chat): address CodeRabbit feedback on slice memoization

Two changes:

- Strengthen the cache-hit predicate to also check the messages
  array reference. Without this, a consumer-side immutable
  mid-replace (`messages = [...slice(0,i), newMsg, ...slic... (continued)

73 of 78 branches covered (93.59%)

Branch coverage included in aggregate %.

154 of 155 relevant lines covered (99.35%)

92.85 hits per line

Jobs
ID Job ID Ran Files Coverage
1 node-22 - 25116581459.1 29 Apr 2026 03:07PM UTC 2
97.42
GitHub Action Run
Source Files on build 25116581459
  • Tree
  • List 2
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #25116581459
  • 11a73131 on github
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc