A performance improvement for speeding up quadratic and cubic discriminants (issue #30517)

30 views
Skip to first unread message

Chris Ozols

unread,
Nov 15, 2026, 7:15:39 AM (5 days ago) Nov 15
to sympy
Hi as it is right now on the main branch it's quite slow in these situations.  I've made a fork of it to help improve it, it speeds up the examples from issue #30517 by about 685x and 391x, with a 189x geometric-mean speedup across 13 benchmarks.  It just checks for these situations and does the direct quadratic and cubic discriminant formulas instead of the general resultant calculation to help out on these.  Its +28 lines, +105 total including tests.

link to my fork

I didn't open a PR because of the current backlog - your contribution docs suggested posting here as an alternative.  Thanks

Oscar Benjamin

unread,
Nov 15, 2026, 7:57:13 AM (4 days ago) Nov 15
to sy...@googlegroups.com
Hi Chris,

That sounds like a reasonable improvement. Feel free to open a PR.

Don't worry about the PR backlog. There has always been a backlog and
it's definitely not going to go away any time soon.

Where in the docs does it say to post here instead of opening a PR?

--
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/80081303-ed2f-4761-a58f-ade86e3e7d27n%40googlegroups.com.

Sangyub Lee

unread,
Nov 15, 2026, 8:09:45 AM (4 days ago) Nov 15
to sympy
Is the performance improvement only helpful for special case or is it helpful without slowing down significantly for general case?
Reply all
Reply to author
Forward
0 new messages