Follow-up on PR #27758: Min/Max performance optimization (fixes #16249)

46 views
Skip to first unread message

MOHAMED LAAREJ

unread,
Mar 14, 2025, 12:59:58 PM3/14/25
to sympy
Hello everyone,

I'm Laarej Mohamed, a student applying for Google Summer of Code with SymPy. I recently submitted a pull request addressing issue #16249 regarding slow Min/Max construction with many arguments.
PR link:  PR #27758
My implementation optimizes the performance of Min/Max construction by:
1. Improving the `_is_connected` method to prioritize faster operations
2. Making `_find_localzeros` conditional on `evaluate=True`

The benchmark results show significant improvements:
- Min with 50 symbols (evaluate=True): 3.24s → 0.99s (3.3x faster)
- Max with 50 symbols (evaluate=True): 3.23s → 0.94s (3.4x faster)
- evaluate=False performance remains fast as expected

There is an unrelated test failure in `test_issue_21890` which was already failing in the main branch (TypeError related to complex number comparison).

I'd appreciate your feedback on whether I should:
1. Proceed with the current PR focused on Min/Max optimization
2. Address the unrelated test failure separately

Thank you for your time and consideration.

Best regards,
Mohamed

Oscar Benjamin

unread,
Mar 29, 2025, 9:10:15 AM3/29/25
to sy...@googlegroups.com
Hi Mohamed,

You said that there is an unrelated test failure but it is not
unrelated. The trasback clearly shows that the code added in the PR is
raising the exception and the test passes on master.

Oscar
> --
> You received this message because you are subscribed to the Google Groups "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/sympy/212f0033-b99a-4d58-be67-3645eca9f312n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages