Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the main-file detection #2558

Closed
wants to merge 2 commits into from

Conversation

lervag
Copy link
Owner

@lervag lervag commented Nov 4, 2022

As a result of #2465, I added a restriction to the compiler module where it won't compile the document unless the main file was verified to be a valid main file. This helped to ensure robustness, at the cost of breaking the work flow for several users.

This PR introduces a minor change to how VimTeX checks if a file is a main file that should resolve most of the issues reported after the more restrictive compiler module. However, I won't merge it immediately, because it may come at a cost of reduced init performance. That is, slower load time for VimTeX. This should only affect large projects, and only if they consist of many/multiple files. But still, it may be a relevant blocker.

Therefore, before I merge this, I would be very happy if users who have large LaTeX documents with multiple files (e.g. books, large theses, etc) could test if this branch introduce a noticable reduced startup time. Please also report if you do not see a reduced performance.

Related issues:

People who may have an interest in this issue: @Rmano, @fauust, @Yorkwn, @shuber2, @krishnakumarg1984, @clason

@shuber2
Copy link
Contributor

shuber2 commented Nov 4, 2022

Regarding startup time, I tested startup time on three larger projects:

  • A 100+ pages research center proposal
  • A 140+ pages book
  • A 100+ pages lecture notes

They all loaded quickly. Only a 3800+ lines tex file of the research proposal took some two seconds to load. But that was also true for the current master branch.

@krishnakumarg1984
Copy link
Contributor

I see virtually no difference when typesetting my (admittedly too long) 329 page PhD thesis. The new commits don't seem to have any impact either way.

@Rmano
Copy link

Rmano commented Nov 5, 2022

I checked on my biggest file (the manual for circuitikz, which is a single-file project tough) and I noticed no difference at all.

@clason
Copy link
Contributor

clason commented Nov 5, 2022

No measurable difference for me (using hyperfine), so 👍

@ejmastnak
Copy link
Contributor

+1 No appreciable difference for me between the feature branch and master on a ~300 page book with multiple chapters in separate files

@lervag
Copy link
Owner Author

lervag commented Nov 5, 2022

Thank you all for the quick feedback! I see no reason to merge this, then.

lervag added a commit that referenced this pull request Nov 5, 2022
@lervag lervag closed this Nov 5, 2022
@lervag lervag deleted the feat/improve-main-file-detection branch November 5, 2022 14:52
shuber2 added a commit to shuber2/vimtex that referenced this pull request Nov 6, 2022
Performance evaluation for the work on PR lervag#2558 gave evidence that
disabling the directory scan method for the main file detection due to
performance concerns appears to be unjustified. Remove this option.

Note that recently g:vimtex_disable_recursive_main_file_detection has
been renamed to g:vimtex_disable_directory_scan_main_file_detection.
lervag pushed a commit that referenced this pull request Nov 6, 2022
Performance evaluation for the work on PR #2558 gave evidence that
disabling the directory scan method for the main file detection due to
performance concerns appears to be unjustified. Remove this option.

Note that recently g:vimtex_disable_recursive_main_file_detection has
been renamed to g:vimtex_disable_directory_scan_main_file_detection.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants