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

Implement caching system for remote files #243

Open
ambihelical opened this issue Jan 16, 2021 · 1 comment
Open

Implement caching system for remote files #243

ambihelical opened this issue Jan 16, 2021 · 1 comment

Comments

@ambihelical
Copy link

I think it would be worthwhile addition to cache editorconfig settings for remote directories (and perhaps all directories if performance warrants it). The cache would hold, for each directory cached, the editor config settings for that directory, including the case of no editor configuration at all.

The first open of a file incurs the penalty of full file system traversal up to the root, but the editor config for each directory visited is cached. The next file open hitting any cached directory is sped up.

There would need to be a way to invalidate the cache if any editorconfig changes have been made, but this should be infrequent. The use of the cache should be optional with a simple configuration setting.

With this in place the impact of traversing the file system for remote files can be ameliorated instead of out-right removing the functionality of editorconfig for remote files as #234 has done, at least by default. I appreciate the motivation for #234, but it breaks editorconfig for remote work out the box, and requires reconfiguration of the regexp list to bring it back.

@10sr
Copy link
Member

10sr commented Feb 14, 2021

Thanks for your suggestion!

Actually, editorconfig-core already caching mechanism, and it seems to work also for remote files 🙆‍♂️ : https://github.com/editorconfig/editorconfig-emacs/blob/master/editorconfig-core-handle.el#L37
It uses file mtime to check if it has been changed last read, so I think the feature you suggested is partially implemented.

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

No branches or pull requests

2 participants