knitr::spin() result not cached, called 3 times per .R file during index build
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- performance
Research direction
Start in src/execute/rmd.ts at markdownFromKnitrSpinScript and its existing TODO, then trace the three calls from readBaseInputIndex described in the issue. Confirm the same .R file is processed repeatedly and verify that per-file caching reduces duplicate Rscript.exe spawns while preserving the spin markdown output.
Written by the indexing model from the issue text.
Description
markdownFromKnitrSpinScript spawns a fresh Rscript.exe process each time it is called, and readBaseInputIndex triggers it 3 times for each .R spin script:
renderFormats→resolveFullMarkdownForFile→markdownForFile→ spinprojectFileMetadata→markdownForFile→ spinengine.partitionedMarkdown→ spin
There is already a TODO in the code:
The spin result (markdown output) does not change between calls within the same render, so caching per file would eliminate 2 of the 3 R process spawns. In a project with many .R spin scripts, this adds up significantly (the reporter in #14225 measured 40s vs 3s).
Repro
https://github.com/byzheng/quarto-metadata-files-test
Context
Surfaced while investigating #14225. The spin caching issue is independent of the cache invalidation bug also reported from that investigation.
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from quarto-dev/quarto-cli
-
binder bug
Difficulty 1/5 Under an hour Newbie friendliness 92/100
quarto-dev/quarto-cli#14907 · 3 comments ·
-
brand bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
quarto-dev/quarto-cli#14891 ·
-
brand bug html revealjs
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
quarto-dev/quarto-cli#14882 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
quarto-dev/quarto-cli#14875 ·
-
Percent scripts: accept raw-string (r""") and '''-delimited markdown cells, as jupytext writes them Openengines-jupyter enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
quarto-dev/quarto-cli#14850 · 2 comments ·
All issues in quarto-dev/quarto-cli
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
babalae/bettergi-scripts-list#3674 ·
-
ecosystem wording
Difficulty 1/5 Under an hour Newbie friendliness 90/100
matrix-org/matrix.org#3649 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
vadimdemedes/ink#1029 ·
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·