-
Notifications
You must be signed in to change notification settings - Fork 395
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
Slow \includegraphic completion when existing a lot of files. #3089
Comments
|
This is the first time I've heard someone complain about performance of the file completion for includegraphics. I could look into it, but it is hard without having a reproducible example. Are you able to build a simple example and a step-by-step guide for how to reproduce the experienced lag? |
I've found it to be quite fast myself, although I might have never really tested it in any crazy large folders.
That's not trivial and probably not so robust. I think, before looking at solutions here, I want to find a reliable way to reproduce the lag. |
I use WSL and put my tex project under I created a folder #!/bin/bash
for ((i = 1; i <= 10000; i++)); do
touch ${i}.txt
done Then, I observed that So I think it is a performance problem about WSL filesystem, rather than vimtex, see also microsoft/WSL#4197 |
Yes, I think this is a performance problem in Windows WSL, and I don't really want to add the complexity here in VimTeX to account for that. Notice that, adding Now, if you were to suggest an updated with a PR, then I might consider to add it after guiding it into something that seems robust enough. |
I can replicate this on Linux as I have accidentally created a stress test for this: It's a total of 39389 files across 20748 subdirectories and typing "\includedirectory" or "\input" or trying to edit a path freezes Neovim for multiple seconds. |
Huh, ok; but is this really a realistic scenario? I mean, why would you ever have so many files and subdirectories - and if you do, why can't you just move the latex source to a separate independent directory? I'm not trying to be difficult, but I'm also not very interested in adding complexity to the project for extremely uncommon edge cases. |
The generated graphics (generating is the reason why there is so many of them) were initially in a different directory and I moved them into the latex source directory, because it would be nice to include them quickly as I sort through them. I thought it would be a nice workflow initially, so I naturally ended up in that situation 😊 I think it's fair to not want to add complexity over this, especially if it involves external commands that might not be available on all platforms. I have searched the documentation for it yet (maybe it is available), but would it be possible to add incremental completion (as an option) rather than listing all files at once? It's not a big deal not to. I can't tell if this would be difficult to implement or even desirable for most users. Thank you for your work. |
The issue with this, IMHO, is that it would break the workflow of most people - myself included. I believe most people would have O(10) image files. Crazy people might have O(100) image files in a document (say, less than 1000). The current implementation would still work well with that. Further, the current behaviour takes the current input and uses it to filter the files as a regex. I.e., let's say you type Now, let's say I add an option for to keep the current default but to allow a "nested" search. Yes, perhaps it would solve the current issue for you, but then someone else would have the exact same issue as you except their files are in a flat structure. This solution would not be adequate for them. Notice, though: you may actually come far here if you instead rely on the built-in file completion. That is, instead of If you are using autocomplete plugins, they may allow you to configure this behaviour as well, although it will probably require some clever config.
It's not very hard to implement, but I'm very skeptical of the value it brings compared to the cost.
Glad you enjoy it! |
Description
My project file structure is:
datasets/
contains a lot of files that are not figures.I want to ignore
datasets/
directory when completing\includegraphics
commands. What should I do?Steps to reproduce
No response
Expected behavior
No response
Actual behavior
No response
Do you use a latexmkrc file?
No
VimtexInfo
The text was updated successfully, but these errors were encountered: