mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-17 20:27:36 -05:00
ui: Have 'guix help' stat less.
This reduces the number of syscalls for: env -i $(type -P strace) -c $(type -P guix) help from 4.3K to 2.2K, thereby reducing startup time. Reported by Julien Lepiller. * guix/ui.scm (run-guix-command): Move %FILE-PORT-NAME-CANONICALIZATION to... (run-guix): ... here.
This commit is contained in:
parent
e059adcb60
commit
ab37731a8d
1 changed files with 32 additions and 32 deletions
|
@ -2139,8 +2139,6 @@ (define module
|
|||
(let ((command-main (module-ref module
|
||||
(symbol-append 'guix- command))))
|
||||
(parameterize ((program-name command))
|
||||
;; Disable canonicalization so we don't don't stat unreasonably.
|
||||
(with-fluids ((%file-port-name-canonicalization #f))
|
||||
(dynamic-wind
|
||||
(const #f)
|
||||
(lambda ()
|
||||
|
@ -2148,7 +2146,7 @@ (define module
|
|||
(lambda ()
|
||||
;; Abuse 'exit-hook' (which is normally meant to be used by the
|
||||
;; REPL) to run things like profiling hooks upon completion.
|
||||
(run-hook exit-hook)))))))
|
||||
(run-hook exit-hook))))))
|
||||
|
||||
(define (run-guix . args)
|
||||
"Run the 'guix' command defined by command line ARGS.
|
||||
|
@ -2160,6 +2158,8 @@ (define option? (cut string-prefix? "-" <>))
|
|||
;; number of 'stat' calls per entry in %LOAD-PATH. Shamelessly remove it.
|
||||
(set! %load-extensions '(".scm"))
|
||||
|
||||
;; Disable canonicalization so we don't don't stat unreasonably.
|
||||
(with-fluids ((%file-port-name-canonicalization #f))
|
||||
(match args
|
||||
(()
|
||||
(format (current-error-port)
|
||||
|
@ -2181,7 +2181,7 @@ (define option? (cut string-prefix? "-" <>))
|
|||
((command args ...)
|
||||
(apply run-guix-command
|
||||
(string->symbol command)
|
||||
args))))
|
||||
args)))))
|
||||
|
||||
(define (guix-main arg0 . args)
|
||||
(initialize-guix)
|
||||
|
|
Loading…
Reference in a new issue