Yield native import scans by elapsed time and bounded work

This commit is contained in:
2026-11-09 19:41:00 +08:00
parent fd6c166f4b
commit 180f66b2af
9 changed files with 67 additions and 16 deletions
+9
View File
@@ -473,3 +473,12 @@ runs in the bubble phase so target handlers can claim it first; it cancels only
this view's gesture. Style toolbars dismiss their own modes on unclaimed Escape,
while input controls retain priority. The helper needs no browser globals at
module load or when called with non-DOM ports.
Native import scanners share `ImportScheduling` (`now`, `yieldTask`,
`frameBudgetMs`, default 6 ms). Array/envelope scanners check elapsed time every
128 scan steps; NDJSON checks after each bounded chunk. A 16 KiB/step work
threshold also yields when the clock does not advance. Cancellation is checked
again after each real task yield. Byte/ordinal cursors, parser versions and source
fingerprints are unchanged. This is a soft budget: a bounded JSON decode is
indivisible, and document-envelope range indexing still precedes record display.