mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
guix package: 'search-path-environment-variables' traverses module tree once.
* guix/scripts/package.scm (search-path-environment-variables)[manifest-entry->package]: Use 'find-best-packages-by-name' instead of 'find-packages-by-name'. On a profile with 140 packages, this reduces execution time of this procedure from 5.8 seconds to 2.9 seconds (50% improvement.)
This commit is contained in:
parent
d2952326ae
commit
27c68457d9
1 changed files with 5 additions and 2 deletions
|
@ -417,8 +417,11 @@ (define* (search-path-environment-variables entries profile
|
|||
(define manifest-entry->package
|
||||
(match-lambda
|
||||
(($ <manifest-entry> name version)
|
||||
(match (append (find-packages-by-name name version)
|
||||
(find-packages-by-name name))
|
||||
;; Use 'find-best-packages-by-name' and not 'find-packages-by-name';
|
||||
;; the former traverses the module tree only once and then allows for
|
||||
;; efficient access via a vhash.
|
||||
(match (or (find-best-packages-by-name name version)
|
||||
(find-best-packages-by-name name #f))
|
||||
((p _ ...) p)
|
||||
(_ #f)))))
|
||||
|
||||
|
|
Loading…
Reference in a new issue