gexp: Cache the module to derivation mappings.
This reduces the number of 'add-data-to-store' cache lookups from 3329 to 2743 (hit rate: 27% to 11%) when running: GUIX_PROFILING=add-data-to-store-cache guix build libreoffice -nd Execution time of "guix build libreoffice -nd" goes from 1.86s to 1.80s. * guix/gexp.scm (imported+compiled-modules): Wrap body in 'mcached'.
This commit is contained in:
		
							parent
							
								
									c57e417eff
								
							
						
					
					
						commit
						f5fca9a82c
					
				
					 1 changed files with 18 additions and 15 deletions
				
			
		| 
						 | 
					@ -660,6 +660,7 @@ names and file names suitable for the #:allowed-references argument to
 | 
				
			||||||
                                    (module-path %load-path))
 | 
					                                    (module-path %load-path))
 | 
				
			||||||
  "Return a pair where the first element is the imported MODULES and the
 | 
					  "Return a pair where the first element is the imported MODULES and the
 | 
				
			||||||
second element is the derivation to compile them."
 | 
					second element is the derivation to compile them."
 | 
				
			||||||
 | 
					  (mcached equal?
 | 
				
			||||||
           (mlet %store-monad ((modules  (if (pair? modules)
 | 
					           (mlet %store-monad ((modules  (if (pair? modules)
 | 
				
			||||||
                                             (imported-modules modules
 | 
					                                             (imported-modules modules
 | 
				
			||||||
                                                               #:system system
 | 
					                                                               #:system system
 | 
				
			||||||
| 
						 | 
					@ -674,7 +675,9 @@ second element is the derivation to compile them."
 | 
				
			||||||
                                                               #:deprecation-warnings
 | 
					                                                               #:deprecation-warnings
 | 
				
			||||||
                                                               deprecation-warnings)
 | 
					                                                               deprecation-warnings)
 | 
				
			||||||
                                             (return #f))))
 | 
					                                             (return #f))))
 | 
				
			||||||
    (return (cons modules compiled))))
 | 
					             (return (cons modules compiled)))
 | 
				
			||||||
 | 
					           modules
 | 
				
			||||||
 | 
					           system extensions guile deprecation-warnings module-path))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(define* (lower-gexp exp
 | 
					(define* (lower-gexp exp
 | 
				
			||||||
                     #:key
 | 
					                     #:key
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue