2
0
Эх сурвалжийг харах

[hxb] add some (commented out) timers

Rudy Ges 1 жил өмнө
parent
commit
aff1255dcc

+ 2 - 0
src/compiler/compilationCache.ml

@@ -71,7 +71,9 @@ class context_cache (index : int) (sign : string) = object(self)
 		(* TODO move this somewhere else, factorize with generate.ml as much as possible *)
 		let anon_identification = new Tanon_identification.tanon_identification ([],"") in
 		let writer = new HxbWriter.hxb_writer anon_identification in
+		(* let t = Timer.timer ["server";"cache context";"write module"] in *)
 		writer#write_module m;
+		(* t(); *)
 		let ch = IO.output_bytes() in
 		writer#export ch;
 		let bytes = IO.close_out ch in

+ 2 - 0
src/compiler/hxb/hxbWriter.ml

@@ -313,9 +313,11 @@ class ['a] hxb_writer
 		);
 
 	method write_pos (p : pos) =
+		(* let t = Timer.timer ["server";"cache context";"write module";"write pos"] in *)
 		chunk#write_string p.pfile;
 		chunk#write_leb128 p.pmin;
 		chunk#write_leb128 p.pmax;
+		(* t() *)
 
 	method write_metadata_entry ((meta,el,p) : metadata_entry) =
 		chunk#write_string (Meta.to_string meta);

+ 2 - 0
src/compiler/serverCompilationContext.ml

@@ -59,7 +59,9 @@ let reset sctx =
 
 let after_save sctx com has_error =
 	if not has_error && com.display.dms_full_typing && com.display.dms_populate_cache then begin
+		(* let t = Timer.timer ["server";"cache context"] in *)
 		CommonCache.cache_context sctx.cs com;
+		(* t(); *)
 		ServerMessage.cached_modules com "" (List.length com.modules);
 	end