File tree Expand file tree Collapse file tree 3 files changed +26
-7
lines changed
Expand file tree Collapse file tree 3 files changed +26
-7
lines changed Original file line number Diff line number Diff line change 177177 (flet ((action (stream )
178178 (call-with-skipping
179179 (lambda ()
180- (map -sources (lambda (source)
181- (force-output stream )
182- (format t " ~& Updating ~S from ~A~% "
183- (project-name source)
184- (location source))
185- (update-source-cache source))))
180+ (pmap -sources (lambda (source)
181+ (force-output stream )
182+ (format t " ~& Updating ~S from ~A~% "
183+ (project-name source)
184+ (location source))
185+ (update-source-cache source))))
186186 :stream stream )))
187187 (if file
188188 (with-open-file (stream file :direction :output
Original file line number Diff line number Diff line change 1010 # :cl-ppcre
1111 # :alexandria
1212 # :drakma
13- # :ironclad)
13+ # :ironclad
14+ # :lparallel)
1415 :serial t
1516 :components ((:file " tarhash" )
1617 (:file " package" )
Original file line number Diff line number Diff line change 130130 (with-simple-restart (skip " Skip ~A source" project-name)
131131 (funcall fun (load-source-file project-name source-file)))))))
132132
133+ (defun pmap-sources (fun)
134+ (let ((dependency-tree (lparallel :make-ptree))
135+ (host-dependency (make-hash-table :test ' equal))
136+ (i 0 ))
137+ (map-sources (lambda (source)
138+ (let ((host (source-host source)))
139+ (lparallel :ptree-fn i (gethash host host-dependency)
140+ (lambda (&optional arg)
141+ (declare (ignore arg))
142+ (funcall fun source))
143+ dependency-tree)
144+ (setf (gethash host host-dependency) (list i))
145+ (incf i))))
146+ (lparallel :ptree-fn ' everything (loop for j below i collect j)
147+ (constantly nil ) dependency-tree)
148+ (lparallel :call-ptree ' everything dependency-tree)
149+ nil ))
150+
133151(defun find-source (name)
134152 (block nil
135153 (map-sources (lambda (source)
You can’t perform that action at this time.
0 commit comments