File tree Expand file tree Collapse file tree 1 file changed +9
-12
lines changed
Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change 4747 [java.net URL]
4848 [java.util.logging Level]
4949 [java.util List Random]
50- [java.util.concurrent TimeUnit LinkedBlockingDeque]
50+ [java.util.concurrent
51+ TimeUnit LinkedBlockingDeque Executors CountDownLatch]
5152 [com.google.javascript.jscomp CompilerOptions CompilationLevel
5253 CompilerOptions$LanguageMode SourceMap$Format
5354 SourceMap$DetailLevel ClosureCodingConvention SourceFile
771772 (let [deque (LinkedBlockingDeque. inputs)
772773 input-set (atom (into #{} (comp (remove nil?) (map :ns )) inputs))
773774 cnt (+ 2 (.. Runtime getRuntime availableProcessors))
774- agents (repeatedly cnt
775- #(agent nil
776- :error-handler
777- (fn [err]
778- (util/debug-prn err))))
775+ latch (CountDownLatch. cnt)
776+ es (Executors/newFixedThreadPool cnt)
779777 compiled (atom [])
780778 failed (atom false )]
781- (doseq [agent agents ]
782- (send agent
783- (fn [agent ]
779+ (dotimes [_ cnt ]
780+ (.execute es
781+ (bound- fn []
784782 (compile-task deque input-set compiled opts failed)
785- agent)))
786- (util/measure compiler-stats
787- " Compile sources" (apply await agents))
783+ (.countDown latch))))
784+ (util/measure compiler-stats " Compile sources" (.await latch))
788785 @compiled))
789786
790787(defn compile-sources
You can’t perform that action at this time.
0 commit comments