Skip to content

Commit 6458c33

Browse files
committed
added limit on commutativity checks for performance
1 parent bd7f465 commit 6458c33

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/matchers.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ function term_matcher_constructor(term, acSets)
181181

182182

183183
T = symtype(data)
184-
if T <: Number
184+
if T <: Number && length(data_args)<COMM_CHECKS_LIMIT[]
185185
f = operation(data)
186186

187187
for inds in acSets(eachindex(data_args), length(data_args))

src/rule.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
@inline alwaystrue(x) = true
3+
const COMM_CHECKS_LIMIT = Ref(10)
34

45
# Matcher patterns with Slot, DefSlot and Segment
56

0 commit comments

Comments
 (0)