2
0
Simon Krajewski 5 сар өмнө
parent
commit
f864d85414

+ 3 - 3
src/codegen/dump.ml

@@ -122,7 +122,7 @@ let dump_types com pretty =
 		);
 		close()
 	in
-	Parallel.run_in_new_pool (fun pool ->
+	Parallel.run_in_new_pool com.timer_ctx (fun pool ->
 		Parallel.ParallelArray.iter pool f (Array.of_list com.types)
 	)
 
@@ -138,7 +138,7 @@ let dump_record com =
 		Buffer.add_string buf s;
 		close()
 	in
-	Parallel.run_in_new_pool (fun pool ->
+	Parallel.run_in_new_pool com.timer_ctx (fun pool ->
 		Parallel.ParallelArray.iter pool f (Array.of_list com.types)
 	)
 
@@ -163,7 +163,7 @@ let dump_position com =
 			| _ ->
 				()
 	in
-	Parallel.run_in_new_pool (fun pool ->
+	Parallel.run_in_new_pool com.timer_ctx (fun pool ->
 		Parallel.ParallelArray.iter pool f (Array.of_list com.types)
 	)
 

+ 3 - 3
src/context/parallel.ml

@@ -14,6 +14,6 @@ module ParallelSeq = struct
 		ParallelArray.iter pool f (Array.of_seq seq)
 end
 
-let run_in_new_pool f =
-	let pool = Domainslib.Task.setup_pool ~num_domains:(Domain.recommended_domain_count() - 1) () in
-	Std.finally (fun () -> Domainslib.Task.teardown_pool pool) f pool
+let run_in_new_pool timer_ctx f =
+	let pool = Timer.time timer_ctx ["domainslib";"setup"] (Domainslib.Task.setup_pool ~num_domains:(Domain.recommended_domain_count() - 1)) () in
+	Std.finally (fun () -> Timer.time timer_ctx ["domainslib";"teardown"] Domainslib.Task.teardown_pool pool) f pool

+ 1 - 1
src/filters/filters.ml

@@ -678,7 +678,7 @@ let run tctx ectx main before_destruction =
 		| _ -> (fun tctx e -> RenameVars.run tctx.c.curclass.cl_path locals e));
 		"mark_switch_break_loops",(fun _ -> mark_switch_break_loops);
 	] in
-	Parallel.run_in_new_pool (fun pool ->
+	Parallel.run_in_new_pool com.timer_ctx (fun pool ->
 		Parallel.ParallelArray.iter pool (run_expression_filters tctx detail_times filters) (Array.of_list new_types)
 	);
 	with_timer tctx.com.timer_ctx detail_times "callbacks" None (fun () ->

+ 1 - 1
src/optimization/analyzer.ml

@@ -1201,7 +1201,7 @@ module Run = struct
 			if config.optimize && config.purity_inference then
 				with_timer com.timer_ctx config.detail_times None ["optimize";"purity-inference"] (fun () -> Purity.infer com);
 			let exc_out = Atomic.make None in
-			Parallel.run_in_new_pool (fun pool ->
+			Parallel.run_in_new_pool com.timer_ctx (fun pool ->
 				Parallel.ParallelArray.iter pool (run_on_type com exc_out pool config) (Array.of_list types);
 			);
 			check_exc_out exc_out