Selaa lähdekoodia

[typing] add some commented out timing functions

Simon Krajewski 7 vuotta sitten
vanhempi
commit
0fd13fd363
4 muutettua tiedostoa jossa 24 lisäystä ja 1 poistoa
  1. 3 0
      src/context/common.ml
  2. 4 0
      src/typing/typeload.ml
  3. 8 0
      src/typing/typeloadModule.ml
  4. 9 1
      src/typing/typeloadParse.ml

+ 3 - 0
src/context/common.ml

@@ -734,6 +734,9 @@ let find_file ctx f =
 		| None -> raise Not_found
 		| Some f -> f)
 
+(* let find_file ctx f =
+	let timer = Timer.timer ["find_file"] in
+	Std.finally timer (find_file ctx) f *)
 
 let mem_size v =
 	Objsize.size_with_headers (Objsize.objsize v [] [])

+ 4 - 0
src/typing/typeload.ml

@@ -159,6 +159,10 @@ let rec load_type_def ctx p t =
 			with
 				Exit -> next()
 
+(* let load_type_def ctx p t =
+	let timer = Timer.timer ["typing";"load_type_def"] in
+	Std.finally timer (load_type_def ctx p) t *)
+
 let resolve_position_by_path ctx path p =
 	let mt = load_type_def ctx p path in
 	let p = (t_infos mt).mt_pos in

+ 8 - 0
src/typing/typeloadModule.ml

@@ -941,6 +941,10 @@ let type_module ctx mpath file ?(is_extern=false) tdecls p =
 	end;
 	m
 
+(* let type_module ctx mpath file ?(is_extern=false) tdecls p =
+	let timer = Timer.timer ["typing";"type_module"] in
+	Std.finally timer (type_module ctx mpath file ~is_extern tdecls) p *)
+
 let type_module_hook = ref (fun _ _ _ -> None)
 
 let load_module ctx m p =
@@ -976,4 +980,8 @@ let load_module ctx m p =
 	if ctx.pass = PTypeField then flush_pass ctx PBuildClass "load_module";
 	m2
 
+(* let load_module ctx m p =
+	let timer = Timer.timer ["typing";"load_module"] in
+	Std.finally timer (load_module ctx m) p *)
+
 ;;

+ 9 - 1
src/typing/typeloadParse.ml

@@ -128,6 +128,10 @@ let resolve_module_file com m remap p =
 	end;
 	file
 
+(* let resolve_module_file com m remap p =
+	let timer = Timer.timer ["typing";"resolve_module_file"] in
+	Std.finally timer (resolve_module_file com m remap) p *)
+
 let parse_module' com m p =
 	let remap = ref (fst m) in
 	let file = resolve_module_file com m remap p in
@@ -173,4 +177,8 @@ let parse_module ctx m p =
 			| EImport _ | EUsing _ -> acc
 		) [(EImport (List.map (fun s -> s,null_pos) (!remap @ [snd m]),INormal),null_pos)] decls)
 	else
-		decls
+		decls
+
+(* let parse_module ctx m p =
+	let timer = Timer.timer ["typing";"parse_module"] in
+	Std.finally timer (parse_module ctx m) p *)