f135b4ae83
Adjust 'git-predicate' to use data structures that perform better when used with git repositories with a large number of files. Previously when matching either a regular file or directory, 'git-predicate' would search a list with a length equal to the number of files in the repository. As a search operation happens for roughly every file in the repository, this meant that the time taken to use 'git-predicate' to traverse all the files in a repository was roughly exponential with respect to the number of files in the repository. Now, for matching regular files or symlinks, 'git-predicate' uses a vhash using the inode value as the key. This should perform roughly in constant amount of time, instead of linear with respect to the number of files in the repository. For matching directories, 'git-predicate' now uses a tree structure stored in association lists. To check if a directory is in the tree, the tree is traversed from the root. The time complexity of this depends on the shape of the tree, but it should be an improvement on searching through the list of all files. * guix/git-download.scm (files->directory-tree, directory-in-tree?): New procedures. (git-predicate): Compute DIRECTORY-TREE. Turn INODES into a vhash. Adjust body of lambda accordingly. Co-authored-by: Ludovic Courtès <ludo@gnu.org> |
||
---|---|---|
.. | ||
build | ||
build-system | ||
import | ||
scripts | ||
store | ||
tests | ||
base16.scm | ||
base32.scm | ||
base64.scm | ||
build-system.scm | ||
cache.scm | ||
combinators.scm | ||
config.scm.in | ||
cpio.scm | ||
cve.scm | ||
cvs-download.scm | ||
derivations.scm | ||
discovery.scm | ||
docker.scm | ||
download.scm | ||
elf.scm | ||
ftp-client.scm | ||
gcrypt.scm | ||
gexp.scm | ||
git-download.scm | ||
git.scm | ||
gnu-maintenance.scm | ||
gnupg.scm | ||
grafts.scm | ||
graph.scm | ||
hash.scm | ||
hg-download.scm | ||
http-client.scm | ||
licenses.scm | ||
memoization.scm | ||
modules.scm | ||
monad-repl.scm | ||
monads.scm | ||
nar.scm | ||
packages.scm | ||
pk-crypto.scm | ||
pki.scm | ||
profiles.scm | ||
records.scm | ||
scripts.scm | ||
search-paths.scm | ||
serialization.scm | ||
sets.scm | ||
ssh.scm | ||
store.scm | ||
svn-download.scm | ||
tests.scm | ||
ui.scm | ||
upstream.scm | ||
utils.scm | ||
workers.scm | ||
zlib.scm |