I have a long list of rules for manipulating expressions. They are of the form:
complexRules = {f[x_, y_]^2 :> (*something*),
f[x_, y_] f[x_, z_] :> (*something*),
f[x_, y_] f[w_, z_] :> (*something*),
g[x_, y_, z_]^2 :> (*something*),
g[x_, y_, z_] g[a_, b_, z_] :> (*something*),
(*and so on*)}
As you can see, the LHS of the rules are fairly complicated patterns. I don't fully understand the construction and uses of such dispatch tables. But my hunch is that they wouldn't benefit from being Dispatched as compared to "static" (patternless) rules like
simpleRules = {anna :> (*something*),
bebe :> (*something*),
cecy :> (*something*),
deedee :> (*something*),
eli :> (*something*),
(*and so on*)}
Is my hunch correct in that complexRules would benefit less from Dispatch than would simpleRules? And if so, by how much?
Comments
Post a Comment