profiles: 'check-for-collisions' filters out more non-collisions upfront.

When running:

  GUIX_PROFILING="gc object-cache" ./pre-inst-env \
    guix install gnome -p /tmp/sdsdfsd --no-grafts -n

this reduces the number of object cache lookup from 115K to 96K, with a
slight CPU and memory usage reduction as well.

* guix/profiles.scm (check-for-collisions)[candidates]: Exclude entries
if their 'item' fields are eq?.
This commit is contained in:
Ludovic Courtès 2021-06-04 23:44:09 +02:00
parent f1e0e5fde3
commit 2ac5e07a89
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5

@ -334,7 +334,10 @@ file name."
(filter-map (lambda (entry)
(let ((other (lookup (manifest-entry-name entry)
(manifest-entry-output entry))))
(and other (list entry other))))
(and other
(not (eq? (manifest-entry-item entry)
(manifest-entry-item other)))
(list entry other))))
(manifest-transitive-entries manifest)))
(define lower-pair