You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Speed up large MKV reading and add open progress (#6772)
Subtitle/track extraction from a Matroska file walks the entire cluster
structure but only needs a tiny fraction of the data: it reads each
block's small header and seeks past the large video/audio payloads. The
64 KB FileStream buffer was counter-productive - the forward skips are
usually smaller than the buffer, so FileStream kept refilling
contiguously and ended up pulling almost the whole file off disk
(~700 MB read to extract ~1.7 MB of subtitles from a 1 GB file).
Use a 4 KB (one page) read buffer instead: the skips now fall outside
the buffer so the skipped payloads are never read, cutting cold-open
disk I/O ~4x (~700 MB -> ~175 MB) and open time several-fold (measured
~5-10x faster cold on the jpsdr 1 GB samples). Memory-mapping (the old
SE4 approach) was measured to be slower here due to synchronous
page-fault stalls, so it was not reintroduced.
Also restore progress feedback when opening large MKV files: extraction
now runs on a background thread (ExtractMatroskaSubtitleAsync) so the UI
stays responsive, and a determinate "Please wait..." window with
percentage progress is shown for files >= 25 MB. PleaseWaitViewModel
gained ReportProgress/ProgressValue/IsIndeterminate (defaults to
indeterminate so existing callers are unchanged).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments