Skip to content

Compilation very slow and laggy #1743

@plowman-c

Description

@plowman-c

Hi, thanks for making this great plugin! I have been using it for a while now but something that bugs me is the speed when compiling.

minimal.vim

call plug#begin('~/.vim/plugged')

Plug 'lervag/vimtex'
let g:tex_flavor='latex'

  let g:vimtex_view_method='skim'
  map ,r :w<CR>:silent !/Applications/Skim.app/Contents/SharedSupport/displayline <C-r>=line('.')<CR> %<.pdf<CR> <bar> :redraw!<CR>

let g:vimtex_quickfix_mode=2
let g:vimtex_quickfix_latexlog =
\{
  \ 'overfull' : 0,
  \ 'underfull': 0,
  \ 'packages' : { 'default' : 0, },
\}
let g:vimtex_view_automatic=1
let g:vimtex_toc_config =
\{
  \ 'name'        : 'ToC',
  \ 'fold_enable' : 1,
  \ 'split_width' : 40,
  \ 'show_numbers': 1,
  \ 'layers'      : ['content', 'todo'],
\}
call plug#end()

syntax on

let g:tex_flavor = "latex"

mwe.tex

\documentclass{revtex4-1}
\begin{document}
Hello world!
\end{document}

Commands/Input

I open my file with vim, then hit \ll to start the vimtex autocompilation with latexmk in the background. If the file hasn't been compiled before, this understandably takes some time to compile and open Skim (my chosen viewer).

Every time I make some changes and hit :w it triggers the compiler (which is desirable behaviour), however this causes vim to become very laggy when moving the cursor or entering text/commands for the next 10 s to 60 s while it compiles.

Question
Is this normal behaviour? How long should it take for the compilation process to finish?
Should my vim interface be laggy while latexmk is running? I tried Googling around but no one was talking about slowness specifically while compiling so I'm starting to wonder if it's normal behaviour, it's just that vimtex is supposed to be a "lightweight" plugin which implies minimal lag and slowness.

With a small file like mwe.tex, lag lasts around 10--20 s after :w but with actual work (e.g. ~1000 lines) it takes more like 30--60 s which is quite inconvenient.

Output from VimtexInfo

  1 System info
  2   OS: Mac OS X 10.13.6 (17G13035)
  3   Vim version: VIM 8.2 (1-1050)
  4   Has clientserver: false
  5
  6 vimtex project: mwe
  7   base: mwe.tex
  8   root: /Users/coreyplowman
  9   tex: /Users/coreyplowman/mwe.tex
 10   out: /Users/coreyplowman/mwe.pdf
 11   log: /Users/coreyplowman/mwe.log
 12   aux: /Users/coreyplowman/mwe.aux
 13   fls: /Users/coreyplowman/mwe.fls
 14   main parser: current file verified
 15   compiler: latexmk
 16     backend: jobs
 17     output: /var/folders/tw/bhk4ylq56nb80y0rtph7cwq80000gp/T/vfXfrUa/1
 18     configuration:
 19       continuous: 1
 20       callback: 1
 21       latexmk options:
 22         -verbose
 23         -file-line-error
 24         -synctex=1
 25         -interaction=nonstopmode
 26       latexmk engine: -pdf
 27     job: process 15892 run
 28     cmd: max_print_line=2000 latexmk -verbose -file-line-error -synctex=1 -interaction=nonstopmode -pdf -pvc -view=none -e '$success_cmd = "echo vimtex_co
 29   viewer: Skim
 30     process:
 31       pid: -
 32       cmd: osascript -e 'set theFile to POSIX file "/Users/coreyplowman/mwe.pdf"' -e 'set thePath to POSIX path of (theFile as alias)' -e 'tell applicatio
 33   qf: LaTeX logfile
 34     config:
 35       overfull: 0
 36       packages:
 37         default: 0
 38       underfull: 0
 39       default: 1
 40   document class:
 41   packages:
 42     amsbsy
 43     amsgen
 44     amsmath
 45     amsopn
 46     amstext
 47     natbib
 48     revsymb4-1
 49     textcase
 50     url

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions