Browse Source

[hl] time Hlopt.optimize

Simon Krajewski 6 years ago
parent
commit
afd974a043
1 changed files with 8 additions and 1 deletions
  1. 8 1
      src/generators/genhl.ml

+ 8 - 1
src/generators/genhl.ml

@@ -3227,7 +3227,14 @@ and make_fun ?gen_content ctx name fidx f cthis cparent =
 	} in
 	ctx.m <- old;
 	Hashtbl.add ctx.defined_funs fidx ();
-	let f = if ctx.optimize then Hlopt.optimize ctx.dump_out (DynArray.get ctx.cstrings.arr) f else f in
+	let f = if ctx.optimize then begin
+		let t = Timer.timer ["generate";"hl";"opt"] in
+		let f = Hlopt.optimize ctx.dump_out (DynArray.get ctx.cstrings.arr) f in
+		t();
+		f
+	end else
+		f
+	in
 	DynArray.add ctx.cfunctions f;
 	capt