Comment #14 on issue 317 by asmeurer: factor() slow
http://code.google.com/p/sympy/issues/detail?id=317

With new polys:

SYMPY_GROUND_TYPES=sympy:

In [1]: a,b,c,d,x = symbols('abcdx')

In [2]: %timeit factor(a-x)
1000 loops, best of 3: 1.37 ms per loop

In [3]: %timeit factor(a*b-x)
100 loops, best of 3: 2.48 ms per loop

In [4]: %timeit factor(a*b-x**2)
100 loops, best of 3: 5.35 ms per loop

In [5]: %timeit factor(a*b-c*x**2)
100 loops, best of 3: 9.22 ms per loop

In [6]: %timeit factor(a*b-c*d*x**2)
10 loops, best of 3: 18.8 ms per loop


SYMPY_GROUND_TYPES=gmpy:

In [1]: a,b,c,d,x = symbols('abcdx')

In [2]: %timeit factor(a-x)
1000 loops, best of 3: 959 us per loop

In [3]: %timeit factor(a*b-x)
1000 loops, best of 3: 1.75 ms per loop

In [4]: %timeit factor(a*b-x**2)
100 loops, best of 3: 2.87 ms per loop

In [5]: %timeit factor(a*b-c*x**2)
100 loops, best of 3: 5.03 ms per loop

In [6]: %timeit factor(a*b-c*d*x**2)
100 loops, best of 3: 9.21 ms per loop

So can this be closed?

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to