mirror of
https://github.com/junegunn/fzf
synced 2026-08-08 19:41:43 +00:00
759b7c3283
- Capacity was byte length, over-allocating by bytes-per-rune (2-4x) - Count non-continuation bytes with SWAR before allocating - Invalid bytes undercount, never overcount, so append covers the gap - Query performance unchanged, this is a memory fix - The gain tracks bytes-per-rune, the cost tracks how much of the line follows the first non-ASCII byte, so the two move independently Measured on 1.4M-line corpora: - Every line CJK: RSS 362MB -> 255MB, ingestion -5% - Mostly-ASCII paths behind a Hangul prefix: RSS 556MB -> 533MB, ingestion +3.5%, the counting pass covering the whole line - The same paths with the Hangul at the end: RSS 563MB -> 535MB, ingestion +0.9%, the counting pass covering six bytes