LaTeX-Workshop: bad building performance compared to latexmk from command line
There seems to be a very big time difference between building from the latex-workshop extension compared to bare command. I have a latex file which loads some packages but isn’t extraordinary big. I don’t have any other extensions running.
If i invoke the latexmk command through the recipe interface (normal out-of-the-box build process from latex-workshop) it takes around 20 seconds to build.
If i fire the same command
latexmk -synctex=1 -interaction=nonestopmode -file-line-error -pdf [filename].tex
from the system terminal it takes arround 5 seconds to build.
If i set this command as the external build command of the extension it’s still slow. If i start the command through the terminal in vscode it’s fast agin.
For all builds i tried with the same changes so i’m quite sure it has nothing to do with multiple vs single runs of pdflatex.
During the entire build process (invoked through the extension) the editor feels very sluggish, thats why i noticed in the first place.
As a workaround: is there any possibility to run an external command (for example latexmk in continuous mode from the system command line) and still trigger parsing the logs with latex-workshop to get the errors and warnings right?
LaTeX Workshop Output
output for recipe
[12:19:11] BUILD command invoked.
[12:19:11] Root file remains unchanged from: [path]/thesis.tex.
[12:19:11] Building root file: [path]/thesis.tex
[12:19:11] Build root file/thesis.tex
[12:19:11] Recipe step 1: latexmk, -synctex=1,-interaction=nonstopmode,-file-line-error,-pdf,-outdir=/ [path],-cd, [path]
[12:19:11] LaTeX build process spawned. PID: 46084.
[12:19:30] LaTeX log parsed with 1 messages.
[12:19:30] Recipe of length 1 finished. PID: 46084.
[12:19:30] Successfully built [path]/thesis.tex.
[12:19:30] No PDF viewer connected for [path]/thesis.pdf
[12:19:30] Parse fls file.
output for external command
[12:39:35] BUILD command invoked.
[12:39:35] Root file remains unchanged from: [path]/thesis.tex.
[12:39:35] Build using the external command: latexmk -synctex=1 -interaction=nonstopmode -file-line-error -pdf -outdir=%OUTDIR% %DOC%
[12:39:35] External build process spawned. PID: 48862.
[12:40:01] Successfully built. PID: 48862
[12:40:01] Successfully built [path]/thesis.tex.
[12:40:01] No PDF viewer connected for [path]/thesis.pdf
[12:40:01] Parse fls file.
Desktop [Required]
- OS: Fedora 31
- VS Code version: 1.41.0
- Extension version: 8.7.1
- TeX distribution version: TeX Live 2019
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 20 (9 by maintainers)
Commits related to this issue
- Add an option to disable the progress bar of the compilation of LaTeX. #1933 — committed to tamuratak/LaTeX-Workshop by tamuratak 4 years ago
Sorry for the long delay, i didn’t find the time to respond.
I tried with version 8.7.2, same results. It doesn’t matter whether the progress bar is turned on or off with
latex-workshop.progress.enabled. Side note: there is a minor bug, if the recipe fails (because there is no corresponding tool, i had a typo) the build icon will stay on the status line.I had a look at the CPU usage during the build process as @tamuratak suggested. The
pdflatexprocess uses around 80-100% of a single core in both cases (spawned via vscode/ spawned via terminal). If i build through vscode, all of the cores go up to 80-100% because of the high CPU usage of several of thecodeprocesses during the complete build process.