[{"data":1,"prerenderedAt":157},["ShallowReactive",2],{"markdown-doc:\u002Fen\u002Fguide\u002Fperformance":3},{"id":4,"title":5,"body":6,"description":145,"extension":146,"keywords":147,"locale":148,"meta":149,"navigation":150,"order":151,"path":152,"section":153,"seo":154,"stem":155,"__hash__":156},"docs\u002Fguide\u002Fperformance.en.md","Incremental rendering and performance",{"type":7,"value":8,"toc":136},"minimark",[9,13,18,33,37,60,64,91,95,119,123,126,133],[10,11,12],"p",{},"Most integrations do not need cache tuning. Keep message identity and configuration stable so unchanged content can be reused. This page is for custom reading contributions and investigations into long-document update costs.",[14,15,17],"h2",{"id":16},"what-is-reused-by-default","What is reused by default",[10,19,20,24,25,28,29,32],{},[21,22,23],"code",{},"QuireMarkdown"," and ",[21,26,27],{},"MdProse"," cache complete top-level Vue block projections by default.\nReuse requires identical native Tree identity, source positions, reference destinations,\nfootnote numbering\u002Fnavigation and rendering configuration. Late definitions can still update\nearlier blocks. Growing paragraphs, lists and tables are projected again; individual nested\nblocks, table rows and cells have no independent cache. Use ",[21,30,31],{},":cache=\"false\""," for a full-projection\ncomparison without disabling incremental parsing.",[14,34,36],{"id":35},"declare-custom-dependencies","Declare custom dependencies",[10,38,39,40,43,44,47,48,51,52,55,56,59],{},"Custom reading contributions reproject conservatively by default, because their codec,\nrender and load functions can read the entire document. ",[21,41,42],{},"cacheKey(document)"," declares all\noutside-node source and external-state dependencies; results are compared with ",[21,45,46],{},"Object.is",".\nContributions that only read their own source, attrs and locale may return a constant key,\nas the Status example does with ",[21,49,50],{},"cacheKey: () => null",". For reference-dependent output, include\nresolution status and target values; for external configuration, include its version or stable\nidentity. A constant must not hide actual dependencies. Built-in links and footnotes are still\nchecked automatically. ",[21,53,54],{},"renderNode"," has the equivalent ",[21,57,58],{},"renderNodeKey(state)","; without it,\nall blocks reproject. HTML blocks with allowLink\u002FallowImage callbacks also reproject so reactive\npolicy inputs continue to be observed.",[14,61,63],{"id":62},"inspect-work-and-bound-retention","Inspect work and bound retention",[10,65,66,67,70,71,74,75,78,79,82,83,86,87,90],{},"Advanced consumers can create one ",[21,68,69],{},"MarkdownRenderer"," per reader from the Vue entry, call\n",[21,72,73],{},"renderer.render(state, locale, prefix, onError, options)",", and inspect ",[21,76,77],{},"renderer.work",".\nCall ",[21,80,81],{},"clear()"," when replacing a document or unmounting; Vue unmounting releases resources.\nKeep the onError function identity stable. ",[21,84,85],{},"renderMarkdown(...)"," always performs full projection.\nDefault retention is at most 2048 blocks and 2,000,000 UTF-16 source units, configurable through\nconstructor options ",[21,88,89],{},"maxBlocks\u002FmaxSourceUnits","; exceeding a budget falls back to projection.\nThese counters and budgets do not measure heap bytes, parsing time or browser painting.",[14,92,94],{"id":93},"other-integration-options","Other integration options",[10,96,97,98,103,104,108,109,111,112,118],{},"The package does not implement the earlier Incremark APIs; see the ",[99,100,102],"a",{"href":101},"\u002Fen\u002Fguide\u002Fcomparison","algorithm comparison",".\nremark\u002Frehype plugins and MDC templates also need separate adaptation.\nReact uses a ",[99,105,107],{"href":106},"\u002Fen\u002Fguide\u002Freact","separate adapter"," over the shared parser and cache rules. Arbitrary HTML template execution and content collections\u002Frouting are outside the reading API. The editor's ",[21,110,27],{}," shares this reading implementation and retains its\nproduct diagram nodes and existing API; see ",[99,113,117],{"href":114,"rel":115},"https:\u002F\u002Fmsfe.quirekit.com\u002Fen\u002Fguide\u002Fmd-editor",[116],"nofollow","MD Editor",".",[14,120,122],{"id":121},"reproduce-a-comparison","Reproduce a comparison",[10,124,125],{},"Use a production build and identical documents with 20 UTF-16 units every 30ms. Compare cache=true and cache=false, warm up each mode, then repeat measurements.\nVerify final text, link destinations, footnote counts and backlinks in both modes; also inspect intermediate prefixes and retained source after stopping.",[10,127,128,129,132],{},"Measure parsing, VNode projection, Vue commits and forced layout separately. Playback duration is not parse time, and forced layout does not measure browser painting.\nLarge lists, tables and paragraphs may each remain a single reprojected block. Top-level traversal and global reference checks still exist; constant cost per chunk is not guaranteed.\n",[21,130,131],{},"MarkdownRenderer.work"," counts only the most recent projection. The Playground does not present an uncontrolled engine speed ranking.",[10,134,135],{},"Historical dirty-worktree measurements do not describe a current release. Record source revision, document hash, browser, hardware, warmups and repetitions alongside correctness results.",{"title":137,"searchDepth":138,"depth":138,"links":139},"",2,[140,141,142,143,144],{"id":16,"depth":138,"text":17},{"id":35,"depth":138,"text":36},{"id":62,"depth":138,"text":63},{"id":93,"depth":138,"text":94},{"id":121,"depth":138,"text":122},"Understand default caching, declare custom dependencies and measure update work.","md",null,"en",{},true,8,"\u002Fen\u002Fguide\u002Fperformance","Reference",{"title":5,"description":145},"guide\u002Fperformance.en","qlahwpRUHj8TdfOihVZBvJ4HUT6EG3lTTZ1x2S9cjkw",1793045320730]