You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In certain environments, tidyall is currently far slower than it needs to be, due to its use of (the bundled version of) File::Zglob.
Consider, for example, a configuration with ignore = **/node_modules/**/* in an environment where there's multiple large directories matching that pattern. In the current implementation, this will result in the file system being fully traversed to generate a list of ignored files. This can take a lot of time, and causes unnecessary I/O. Checking if a given file name is to be ignored can be achieved without any I/O at all.
This issue is made worse by this operation potentially happening many times for the same pattern, depending on configuration.
I'm not sure what solution to suggest. It might be nice to get rid of the unmaintained File::Zglob module you currently have to bundle, and the code of which looks pretty dire to me. Checking whether or not to ignore a path could be done pretty easily by compiling the pattern to a regex or similar. Maybe it's worth keeping File::Zglob for the actual globbing portion, but it doesn't seem too hard to replace for that either.
Alternatives that leave File::Zglob in place as is might be to provide a different way of ignoring entire directories (maybe with ignore=dir/), in such a way that no globbing to find ignores would be performed at all, or perhaps allowing non-zglob patterns such as regular expressions to be used in configuration directives.
The text was updated successfully, but these errors were encountered:
Or ... you could test out my new replacement for tidyall, precious. I think it should be usable now but there's no docs yet. If you're interested I can help you create the config file.
In certain environments, tidyall is currently far slower than it needs to be, due to its use of (the bundled version of)
File::Zglob
.Consider, for example, a configuration with
ignore = **/node_modules/**/*
in an environment where there's multiple large directories matching that pattern. In the current implementation, this will result in the file system being fully traversed to generate a list of ignored files. This can take a lot of time, and causes unnecessary I/O. Checking if a given file name is to be ignored can be achieved without any I/O at all.This issue is made worse by this operation potentially happening many times for the same pattern, depending on configuration.
I'm not sure what solution to suggest. It might be nice to get rid of the unmaintained
File::Zglob
module you currently have to bundle, and the code of which looks pretty dire to me. Checking whether or not to ignore a path could be done pretty easily by compiling the pattern to a regex or similar. Maybe it's worth keepingFile::Zglob
for the actual globbing portion, but it doesn't seem too hard to replace for that either.Alternatives that leave
File::Zglob
in place as is might be to provide a different way of ignoring entire directories (maybe withignore=dir/
), in such a way that no globbing to find ignores would be performed at all, or perhaps allowing non-zglob patterns such as regular expressions to be used in configuration directives.The text was updated successfully, but these errors were encountered: