ncdu-zig/src
Yorhel d523a77fdc Improve exclude pattern matching performance (and behavior, a bit)
Behavioral changes:
- A single wildcard ('*') does not cross directory boundary anymore.
  Previously 'a*b' would also match 'a/b', but no other tool that I am
  aware of matches paths that way. This change breaks compatibility with
  old exclude patterns but improves consistency with other tools.
- Patterns with a trailing '/' now prevent recursing into the directory.
  Previously any directory excluded with such a pattern would show up as
  a regular directory with all its contents excluded, but now the
  directory entry itself shows up as excluded.
- If the path given to ncdu matches one of the exclude patterns, the old
  implementation would exclude every file/dir being read, this new
  implementation would instead ignore the rule. Not quite sure how to
  best handle this case, perhaps just exit with an error message?

Performance wise, I haven't yet found a scenario where this
implementation is slower than the old one and it's *significantly*
faster in some cases - in particular when using a large amount of
patterns, especially with literal paths and file names.

That's not to say this implementation is anywhere near optimal:
- A list of relevant patterns is constructed for each directory being
  scanned. It may be possible to merge pattern lists that share
  the same prefix, which could both reduce memory use and the number of
  patterns that need to be matched upon entering a directory.
- A hash table with dynamic arrays as values is just garbage from a
  memory allocation point of view.
- This still uses libc fnmatch(), but there's an opportunity to
  precompile patterns for faster matching.
2022-08-10 09:46:39 +02:00
..
browser.zig Fix build with zig 0.10.0-dev.1946+6f4343b61 2022-04-28 11:03:19 +02:00
delete.zig Version 2.0.1 + copyright year bump 2022-01-01 16:01:47 +01:00
exclude.zig Improve exclude pattern matching performance (and behavior, a bit) 2022-08-10 09:46:39 +02:00
main.zig Improve exclude pattern matching performance (and behavior, a bit) 2022-08-10 09:46:39 +02:00
model.zig Fix unreferenced test in model.zig 2022-08-08 18:23:53 +02:00
ncurses_refs.c Version 2.0.1 + copyright year bump 2022-01-01 16:01:47 +01:00
scan.zig Improve exclude pattern matching performance (and behavior, a bit) 2022-08-10 09:46:39 +02:00
ui.zig Set default attributes to the whole window during curses init 2022-06-15 06:17:38 +02:00
util.zig Use natsort when sorting by name 2022-02-03 10:59:44 +01:00