mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 07:26:13 -05:00
ui: 'load*' compiles with '-O1'.
With this change, the wall-clock time of: guix system build --no-grafts -d gnu/system/install.scm goes from 5.0s to 2.3s on Guile 3.0.5. * guix/ui.scm (without-compiler-optimizations): New macro. (load*): Use it.
This commit is contained in:
parent
4288806111
commit
a0ad636167
1 changed files with 14 additions and 1 deletions
15
guix/ui.scm
15
guix/ui.scm
|
@ -196,6 +196,18 @@ (define (frame-with-source frame)
|
|||
(stack-ref stack 1) ;skip the 'throw' frame
|
||||
last))))
|
||||
|
||||
(cond-expand
|
||||
(guile-3
|
||||
(define-syntax-rule (without-compiler-optimizations exp)
|
||||
;; Compile with the baseline compiler (-O1), which is much less expensive
|
||||
;; than -O2.
|
||||
(parameterize (((@ (system base compile) default-optimization-level) 1))
|
||||
exp)))
|
||||
(else
|
||||
(define-syntax-rule (without-compiler-optimizations exp)
|
||||
;; No easy way to turn off optimizations on Guile 2.2.
|
||||
exp)))
|
||||
|
||||
(define* (load* file user-module
|
||||
#:key (on-error 'nothing-special))
|
||||
"Load the user provided Scheme source code FILE."
|
||||
|
@ -225,7 +237,8 @@ (define tag
|
|||
;; search for FILE in %LOAD-PATH. Note: use 'load', not
|
||||
;; 'primitive-load', so that FILE is compiled, which then allows
|
||||
;; us to provide better error reporting with source line numbers.
|
||||
(load (canonicalize-path file)))
|
||||
(without-compiler-optimizations
|
||||
(load (canonicalize-path file))))
|
||||
(const #f))))))
|
||||
(lambda _
|
||||
;; XXX: Errors are reported from the pre-unwind handler below, but
|
||||
|
|
Loading…
Reference in a new issue