shithub: mc

Download patch

ref: 3ca7a098ddb3aacabafb6c20a57feec1dbafe4ab
parent: f069b33395af1e4a5213b5f5110d583c0af5be7b
author: Ori Bernstein <[email protected]>
date: Wed Dec 27 06:58:31 EST 2017

Remove trace calls from hot path.

--- a/lib/regex/interp.myr
+++ b/lib/regex/interp.myr
@@ -246,8 +246,10 @@
 			thr = re.runq
 			re.runq = thr.next
 
-			trace(re, thr, "\nrunning tid={}, ip={}, s[{}]={}\n", \
-				thr.tid, thr.ip, re.strp, std.decode(re.str[re.strp:]))
+			if re.trace
+				trace(re, thr, "\nrunning tid={}, ip={}, s[{}]={}\n", \
+					thr.tid, thr.ip, re.strp, std.decode(re.str[re.strp:]))
+			;;
 			ip = thr.ip
 			consumed = step(re, thr, -1)
 			while !consumed
@@ -288,7 +290,6 @@
 			;;
 		;;
 		std.bsclear(states)
-		trace(re, Zthr, "switch\n")
 		re.runq = re.expired
 		re.expired = Zthr
 		re.expiredtail = Zthr
@@ -458,13 +459,10 @@
 	thr.mgroup = [][:]
 	re.nthr++
 
-	trace(re, thr, "\tcreated {}", thr.tid)
-
 	-> thr
 }
 
 const thrfree = {re, thr
-	trace(re, thr, "\t\tcleanup {}\n", thr.tid)
 	std.slfree(thr.mgroup)
 	std.free(thr)
 }