perf(tokenizer): single-pass Yomitan scan with cross-line caching and prefetch fixes (#185)

This commit is contained in:
2026-08-06 21:44:09 -07:00
committed by GitHub
parent 441ecf3c04
commit dbdf578c68
38 changed files with 4073 additions and 1720 deletions
@@ -7,6 +7,12 @@ export function handleCharacterDictionaryAutoSyncComplete(
deps: {
hasParserWindow: () => boolean;
clearParserCaches: () => void;
/**
* Drops cached reads of the generated dictionary (character images, and the
* name candidates the scanner uses to skip lookups). Runs before the
* refreshes below so they re-tokenize against the new dictionary content.
*/
invalidateCharacterDictionaryLookups?: () => void;
invalidateTokenizationCache: () => void;
refreshSubtitlePrefetch: () => void;
refreshCurrentSubtitle: () => void;
@@ -14,6 +20,7 @@ export function handleCharacterDictionaryAutoSyncComplete(
},
): void {
if (completion.changed) {
deps.invalidateCharacterDictionaryLookups?.();
if (deps.hasParserWindow()) {
deps.clearParserCaches();
}