derivations: Optimize `build-expression->derivation'.
This reduces the execution time of "guix build -e '(@ (gnu packages emacs) emacs)' -d" by 6%, from 1.15s to 1.08s. * guix/derivations.scm (build-expression->derivation): Write the builder as UTF-8.
This commit is contained in:
		
							parent
							
								
									d80855999a
								
							
						
					
					
						commit
						0bb1aa9e05
					
				
					 1 changed files with 15 additions and 8 deletions
				
			
		| 
						 | 
					@ -741,14 +741,21 @@ omitted or is #f, the value of the `%guile-for-build' fluid is used instead."
 | 
				
			||||||
                      (unsetenv "LD_LIBRARY_PATH")))
 | 
					                      (unsetenv "LD_LIBRARY_PATH")))
 | 
				
			||||||
         (builder  (add-text-to-store store
 | 
					         (builder  (add-text-to-store store
 | 
				
			||||||
                                      (string-append name "-guile-builder")
 | 
					                                      (string-append name "-guile-builder")
 | 
				
			||||||
                                      (string-append
 | 
					
 | 
				
			||||||
                                       (object->string prologue)
 | 
					                                      ;; Explicitly use UTF-8 for determinism,
 | 
				
			||||||
                                       (object->string
 | 
					                                      ;; and also because UTF-8 output is faster.
 | 
				
			||||||
 | 
					                                      (with-fluids ((%default-port-encoding
 | 
				
			||||||
 | 
					                                                     "UTF-8"))
 | 
				
			||||||
 | 
					                                        (call-with-output-string
 | 
				
			||||||
 | 
					                                         (lambda (port)
 | 
				
			||||||
 | 
					                                           (write prologue port)
 | 
				
			||||||
 | 
					                                           (write
 | 
				
			||||||
                                            `(exit
 | 
					                                            `(exit
 | 
				
			||||||
                                              ,(match exp
 | 
					                                              ,(match exp
 | 
				
			||||||
                                                 ((_ ...)
 | 
					                                                 ((_ ...)
 | 
				
			||||||
                                                  (remove module-form? exp))
 | 
					                                                  (remove module-form? exp))
 | 
				
			||||||
                                             (_ `(,exp))))))
 | 
					                                                 (_ `(,exp))))
 | 
				
			||||||
 | 
					                                            port))))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                                      ;; The references don't really matter
 | 
					                                      ;; The references don't really matter
 | 
				
			||||||
                                      ;; since the builder is always used in
 | 
					                                      ;; since the builder is always used in
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue