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
Originally posted by ma-riviere June 14, 2022
Hello Quarto,
I'm wondering if there is a way to make Quarto (or Pandoc) use more threads/cores ?
I'm currently compiling a document to HTML (from R), and it takes more than 3 hours. The document is not that long: 2700 lines (more than half of those being text). There are no complex computations (the knitting in itself takes only a few minutes), but once it's done knitting, it will take close to 3 hours to output the HTML document (which is roughly 15MB in size).
During that whole time, only ~5% of my CPU is used by the Deno virtual machine, so I was wondering if there was a way to have it use more CPU resources to speed up the process ?
We found a number of performance issues in GT which we need to fix, but those will unfortunately take a while.
We now have a 2s timeout for the diff operation, after which we give up doing source line recovery (post 1.0 I'm confident we can bring it back with a better algorithm).
code-link is the culprit for the engine-postprocess timing, which is about 10s here. I recommend disabling that for now, because fixing it will be a relatively large task
Then, removing self-contained also reduces the runtime by ~10s.
Given all these changes, the total runtime is dominated by render-execute, which is knitr:
We also verified through profiling that GT is responsible for the vast majority of the runtime in render-execute.
It's still worrisome that pandoc takes a couple of seconds on this input (that's probably our filters, the profiling of which I haven't enabled yet.)
So, unfortunately, the appropriate resolution here needs to fix a number of different issues.
code-link is the culprit for the engine-postprocess timing, which is about 10s here. I recommend disabling that for now, because fixing it will be a relatively large task
@cscheid about this, is this the part where downlit package is used and some performance issues are with R functions in xml2 and downlit 📦 or other process internal to Quarto ? Just curious as I already notice some improvement to make (not on performance though). Thanks
Not sure this belongs here, but in RStudio on macOS, after the qmd file is done rendering, the GUI locks up -- I can't edit text or use the console for 20-30 seconds, even after the rendered html file appears in the Viewer pane.
@cscheid It seems the problem is over 😄. Just rendered my "long" document full of tables again, and it barely took a few minutes, with no slowdown after all chunks were parsed. Thanks !
R: 4.2.1 (2022-06-23)
OS: Ubuntu 20.04.4 LTS
Pandoc: 2.19.2
Quarto: 1.1.251
Edit: there's a 'Warning: diff of engine output timed out. No source lines will be available.' that shows when that page is done rendering. Might be linked to this sudden speed gain.
My problem is related to the run time, but not exactly the same.
My error looks like this:
I am publishing 77 html quarto files to Netlify with each page having at least one image in the ![]() format. To get a sense of the amount of content and whether this is the problem, my website I was able to publish is here. There does not seem to be a solution for non-code related run times. I cannot tell which file is in bin/quarto.js:109513:17 to address it.
@oscardssmith Thanks for your interest in this issue. A few things that would help us assist you better:
The issue status is already displayed as "open" at the top. Asking about status sends unnecessary notifications to all watchers.
To help debug compilation performance issues, we'd need:
Software version you're using
A minimal reproducible example (even just the problematic slides structure)
System specs if relevant
Any error messages or specific behaviour you're seeing
Seems to be compiling forever
This could mean anything from 30 seconds to genuinely hanging.
Without these details, it's quite difficult for maintainers or other users to provide meaningful assistance.
Would you mind opening a separate issue or better a discussion referencing this issue with these details? That way we can properly track and address your specific case.
Activity
[-]Having Quarto (or Pandoc) use more cores / threads ?[/-][+]Long render times[/+]cscheid commentedon Jun 15, 2022
Collecting data
Here's a partial flamegraph of a smaller version of the file @ma-riviere shared with us:
One of the culprits is a call to https://github.com/kpdecker/jsdiff, which is taking 20s to diff a 500LOC file against a 17kLOC file with 260 total changes. That's surprisingly large. In contrast, a call to unix
diffwith the same inputs is instant.jjallaire commentedon Jun 15, 2022
You could just set a threshold for the file sizes for which we'll try to do this mapping?
cscheid commentedon Jun 17, 2022
Updates:
code-linkis the culprit for theengine-postprocesstiming, which is about 10s here. I recommend disabling that for now, because fixing it will be a relatively large taskself-containedalso reduces the runtime by ~10s.Given all these changes, the total runtime is dominated by
render-execute, which is knitr:We also verified through profiling that GT is responsible for the vast majority of the runtime in
render-execute.It's still worrisome that pandoc takes a couple of seconds on this input (that's probably our filters, the profiling of which I haven't enabled yet.)
So, unfortunately, the appropriate resolution here needs to fix a number of different issues.
cderv commentedon Jun 17, 2022
@cscheid about this, is this the part where downlit package is used and some performance issues are with R functions in xml2 and downlit 📦 or other process internal to Quarto ? Just curious as I already notice some improvement to make (not on performance though). Thanks
grasshoppermouse commentedon Aug 22, 2022
Not sure this belongs here, but in RStudio on macOS, after the qmd file is done rendering, the GUI locks up -- I can't edit text or use the console for 20-30 seconds, even after the rendered html file appears in the Viewer pane.
cscheid commentedon Aug 22, 2022
@grasshoppermouse If it's an RStudio IDE issue, please file that on the RStudio IDE repository.
grasshoppermouse commentedon Aug 22, 2022
How can I tell? I've never had this problem with the original knitr/rmarkdown workflow.
cscheid commentedon Aug 22, 2022
You mentioned the problem is that RStudio on macOS freezes for you after building. That means it's an RStudio issue.
ma-riviere commentedon Sep 21, 2022
@cscheid It seems the problem is over 😄. Just rendered my "long" document full of tables again, and it barely took a few minutes, with no slowdown after all chunks were parsed. Thanks !
Edit: there's a 'Warning: diff of engine output timed out. No source lines will be available.' that shows when that page is done rendering. Might be linked to this sudden speed gain.
sophiestrazie commentedon May 28, 2023
My problem is related to the run time, but not exactly the same.
My error looks like this:
I am publishing 77 html quarto files to Netlify with each page having at least one image in the
![]()format. To get a sense of the amount of content and whether this is the problem, my website I was able to publish is here. There does not seem to be a solution for non-code related run times. I cannot tell which file is inbin/quarto.js:109513:17to address it.oscardssmith commentedon Jul 22, 2025
What's the status here? I seem to be in a similar situation of a presentation with ~2k lines that seems to be compiling forever.
mcanouil commentedon Jul 22, 2025
@oscardssmith Thanks for your interest in this issue. A few things that would help us assist you better:
The issue status is already displayed as "open" at the top. Asking about status sends unnecessary notifications to all watchers.
To help debug compilation performance issues, we'd need:
This could mean anything from 30 seconds to genuinely hanging.
Without these details, it's quite difficult for maintainers or other users to provide meaningful assistance.
Would you mind opening a separate issue or better a discussion referencing this issue with these details? That way we can properly track and address your specific case.