- cross-posted to:
- rust@programming.dev
- cross-posted to:
- rust@programming.dev
cross-posted from: https://programming.dev/post/10657765
I made a replacement for the venerable paccheck. It checks if files managed by the package manger have changed and if so reports that back to the user. Unlike paccheck it is cross distro (supports Debian too and could be further extended), and it uses all your CPU cores to be as fast as possible.
Oh and it is written in Rust (that may be a plus or minus depending on your opinion, but it wouldn’t have happened at all in any language except Rust, and Rust makes it very easy to add this sort of parallelism).
There are more details (including benchmarks) in the readme on github. Maybe it is useful to some of you.
(The main goal of this project is not actually the program produced so far, but to continue building this into a library. I have a larger project in the planning phase that needs this (in library form) as part of it.)
Damn, that’s impressive.
I went ahead and implemented support for filtering packages (just made a new release: v0.1.3).
I am of course still faster. Here are two examples that show a small package (where it doesn’t really matter that much) and a huge package (where it makes a massive difference). Excuse the strange paths, this is straight from the development tree.
Lets check on pacman itself, and lets include config files too (not sure if pacman has that option even?). Config files or not doesn’t make a measurable difference though:
Lets check on davici-resolve as well. Which is massive (5.89 GB):
What about a some midsized packages (vtk 359 MB, linux 131 MB)?
For small sizes where neither tool performs much work, the majority is spent on fixed overheads that both tools have (loading the binary, setting up glibc internals, parsing the command line arguments, etc). For medium sizes paketkoll pulls ahead quite rapidly. And for large sizes pacman is painfully slow.
Just for laughs I decided to check an empty meta-package (base, 0 bytes). Here pacman actually beats paketkoll, slightly. Not a useful scenario, but for full transparency I should include it:
I always start a threadpool regardless of if I have work to do (and changing that would slow the case I actually care about). That is the most likely cause of this slightly larger fixed overhead.