hermes-agent/apps
Brooklyn Nicholson f64b719321 perf(desktop): cache short markdown parses too
parseMarkdownIntoBlocksCached bypassed its cache for text under 1024
chars, on the theory that re-lexing a short message is cheap. The lex is
cheap; what it returns is not free. `parseMarkdownIntoBlocks` builds a
fresh array every call (verified in streamdown's dist: `let r=[]` ...
`return r`), and Streamdown mirrors the block list into useState — so a
new array identity for UNCHANGED text re-renders Streamdown and every
Block beneath it.

Most messages are short, so most of the transcript was on the uncached
path. Caching every length cuts the idle cost of five mounted tiles:

  Streamdown   5.2ms -> 2.6ms
  Block        128ms -> 85ms
  Ct           122ms -> 81ms

Cache bumped 64 -> 256 entries to cover the now-larger key space.

This does NOT reduce Streamdown's 105 idle self-renders — array identity
turned out not to be what drives those, and I verified the cache returns
a stable identity, so that root is still open. This is a cost win, not
the churn fix.
2026-07-26 17:02:59 -05:00
..
bootstrap-installer ci(js-tests): split check into parallel matrix shards per workspace (#70252) 2026-07-23 18:45:16 -04:00
desktop perf(desktop): cache short markdown parses too 2026-07-26 17:02:59 -05:00
shared feat(billing): carry the payment-method union through to clients (#71542) 2026-07-27 01:49:43 +05:30