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

Option to defer file/directory scanning on load until later #1673

Open
starfishpatkhoo opened this issue Nov 29, 2023 · 5 comments · May be fixed by #1455
Open

Option to defer file/directory scanning on load until later #1673

starfishpatkhoo opened this issue Nov 29, 2023 · 5 comments · May be fixed by #1455
Labels
dirmonitor enhancement New feature or request

Comments

@starfishpatkhoo
Copy link

starfishpatkhoo commented Nov 29, 2023

I've been looking into the file/directory scanning/watching in Lite-XL and I understand why things are done this way. But I've a suggestion to make, perhaps as a new config option.

When Lite-XL is launched with a specific file to load, it usually starts to scan that file's folder for all files, etc. The default limit is 2000 files. Now, if this happens to be a file on a network folder, or a slow USB drive, or some mounted folder from GDrive or Samba/NFS/etc etc etc, and if there were a lot of files/subdirs, it could take a user-noticable delay before the main UI is ready.

Regretfully, setting the max files to a small number (eg. 10) does not speed up this process because the directory listing and traversal (over the network) would have already been issued and Lite-XL will wait for the full reply before noticing that oops, there are more than 10 items in the list. This is especially true if the folder happens to have many files - for example, 1000 *.log files..

To reproduce, just have a large folder and many files in a network path and lite-xl <network-path/some-file>

I'd like to suggest that IF Treeview is hidden (via, plugin/setting/etc), then defer the file/dir scan until later. I believe dirwatch will automatically execute .. later, right? Not only that, if I hit open-file later, the file listing is re-populated anyway.

In this way, we achieve two things:

  1. UI response is much faster when launching Lite-XL with a file from a network path
  2. We don't hit the network server/USB device with both a file open+read and a directory traversal request at the same time (or back to back)

Of course, if someone loaded the network file, and then show Treeview, or hit open-file or find-file immediately after, then sure, it should have a delay until the traversal / loading of file information into memory is complete. But I feel that's fine because the user explicitly forced a directory traversal.

Now I suggest this to be an option because how would Lite-XL know that the file resides in a network path anyway? Hence, it's an option for users who have to deal with many files in a large directory structure to speed up the time to launch and start editing.

Yes, of course, one can simply tweak their workflow and not put so many files in one folder structure, or copy stuff to a local drive first etc. But I thought I should at least ask this question and put the suggestion out there. What do you think?

@Guldoman
Copy link
Member

Thank you for the feedback!

With #1599 Lite XL should stop scanning the tree if it's taking too long. It wasn't working previously because of an oversight, but should now. Let us know if that's not the case.

For the next major release we'll also work on integrating #1455, which basically does most of what you're proposing.

@Guldoman Guldoman added enhancement New feature or request dirmonitor labels Nov 29, 2023
@Guldoman Guldoman linked a pull request Nov 29, 2023 that will close this issue
@starfishpatkhoo
Copy link
Author

Nice! Are there nightly binaries somewhere I can quickly download and try #1599 ? Would be fanastic if the timeout was configurable, because maybe it needs to be longer or shorter depending on the network latency, VPN/SSH tunnel, blah blah etc..

As for #1455, I'm looking forward ^_^. The benefits outweight the costs I feel. Any ideas when we'll see the release?

I have to say, Lite-XL is dope! You guys have done an awesome job, keep it up!

@adamharrison
Copy link
Member

adamharrison commented Nov 30, 2023

Nice! Are there nightly binaries somewhere I can quickly download and try #1599 ? Would be fanastic if the timeout was configurable, because maybe it needs to be longer or shorter depending on the network latency, VPN/SSH tunnel, blah blah etc..

In theory you can grab the binaries from CI here: https://github.com/lite-xl/lite-xl/actions/runs/7048712495; although these are debug binaries (we'll be fixing that as well to make them proper release binaries with every commit in the near future).

As for #1455, I'm looking forward ^_^. The benefits outweight the costs I feel. Any ideas when we'll see the release?

We have a pre-release coming out very soon (we just closed the last PR for the release this morning: https://github.com/lite-xl/lite-xl/projects/9); which should include #1599. #1455 will be a bit longer, but it'll be basically my top priority after we get the bugfix release out for our next major release.

I have to say, Lite-XL is dope! You guys have done an awesome job, keep it up!

❤️

@jgmdev
Copy link
Member

jgmdev commented Dec 1, 2023

As for #1455, I'm looking forward ^_^. The benefits outweight the costs I feel. Any ideas when we'll see the release?

If you are interested that change is already incorporated in Pragtical. Have been enjoying that great PR for a couple of months already, fixes many issues with current implementation.

@starfishpatkhoo
Copy link
Author

As for #1455, I'm looking forward ^_^. The benefits outweight the costs I feel. Any ideas when we'll see the release?

If you are interested that change is already incorporated in Pragtical. Have been enjoying that great PR for a couple of months already, fixes many issues with current implementation.

Oh! It looks very interesting, all the benefits of Lite-XL, but in a pre-configured / opinionated package? What else is different? Let me invesitgate further... Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dirmonitor enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants