packages: Micro-optimize `package-derivation'.
* guix/packages.scm (package-derivation): Move `cache' call before the traversal of PACKAGE's inputs.master
parent
df7bbd3813
commit
ead1f1086d
|
@ -221,6 +221,13 @@ recursively."
|
|||
#:optional (system (%current-system)))
|
||||
"Return the derivation of PACKAGE for SYSTEM."
|
||||
(or (cached-derivation package system)
|
||||
|
||||
;; Compute the derivation and cache the result. Caching is
|
||||
;; important because some derivations, such as the implicit inputs
|
||||
;; of the GNU build system, will be queried many, many times in a
|
||||
;; row.
|
||||
(cache
|
||||
package system
|
||||
(match package
|
||||
(($ <package> name version source (= build-system-builder builder)
|
||||
args inputs propagated-inputs native-inputs self-native-input?
|
||||
|
@ -254,11 +261,6 @@ recursively."
|
|||
(input x))))))
|
||||
(package-transitive-inputs package))))
|
||||
|
||||
;; Compute the derivation and cache the result. Caching is
|
||||
;; important because some derivations, such as the implicit inputs
|
||||
;; of the GNU build system, will be queried many, many times in a
|
||||
;; row.
|
||||
(cache package system
|
||||
(apply builder
|
||||
store (package-full-name package)
|
||||
(and source (package-source-derivation store source))
|
||||
|
|
Reference in New Issue