matchpy: `ManyToOneReplacer` slow for small expressions

I have added ~1700 ReplacementRules in ManyToOneReplacer. The .replace() has become very slow even for very small expressions(like 2*x).

File: https://github.com/parsoyaarihant/sympy/blob/502fd311d64155560383a5f4f3b2710c318dc410/sympy/integrals/rubi/patterns.py

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 38 (4 by maintainers)

Most upvoted comments

I have run into a couple of bugs in the code generation while testing the new rubi rules. I will let you know once I get them fixed.

An option could be to use tuples with different lengths and just leave the optional out if it is None.