summaryrefslogtreecommitdiff
path: root/lib/regex
diff options
context:
space:
mode:
authorOri Bernstein <ori@markovcorp.com>2017-12-27 11:58:31 -0800
committerOri Bernstein <ori@markovcorp.com>2017-12-27 11:58:31 -0800
commit3ca7a098ddb3aacabafb6c20a57feec1dbafe4ab (patch)
tree4ab9df0ce19564b6c7d54090e7d23255d8389327 /lib/regex
parentf069b33395af1e4a5213b5f5110d583c0af5be7b (diff)
downloadmc-3ca7a098ddb3aacabafb6c20a57feec1dbafe4ab.tar.gz
Remove trace calls from hot path.
Diffstat (limited to 'lib/regex')
-rw-r--r--lib/regex/interp.myr10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/regex/interp.myr b/lib/regex/interp.myr
index e7449b1..0bc47e6 100644
--- a/lib/regex/interp.myr
+++ b/lib/regex/interp.myr
@@ -246,8 +246,10 @@ const run = {re, str, idx, wholestr
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 @@ const run = {re, str, idx, wholestr
;;
;;
std.bsclear(states)
- trace(re, Zthr, "switch\n")
re.runq = re.expired
re.expired = Zthr
re.expiredtail = Zthr
@@ -458,13 +459,10 @@ const mkthread = {re, ip
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)
}