id,summary,reporter,owner,description,type,status,priority,milestone,component,resolution,keywords,cc,merged,author,reviewer,upstream,work_issues,branch,commit,dependencies,stopgaps
7578,Slowness of InfinitePolynomialRing basic arithmetic,SimonKing,SimonKing,"[http://groups.google.com/group/sage-devel/browse_thread/thread/20e0fc8f5c5be582 Martin Albrecht] reported the following example:
{{{
sage: X. = InfinitePolynomialRing(QQ)
sage: x10000 = x[10000]
sage: x10001 = x[10001]
sage: %time 1/2*x10000
CPU times: user 43.09 s, sys: 0.02 s, total: 43.12 s
Wall time: 43.12 s
1/2*x10000
}}}
This is inacceptably slow.
Note that this problem does not occur with the sparse implementation of infinite polynomial rings:
{{{
sage: X. = InfinitePolynomialRing(QQ,implementation='sparse')
sage: x10000 = x[10000]
sage: x10001 = x[10001]
sage: %time 1/2*x10000
CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
Wall time: 0.00 s
1/2*x10000
}}}
Part of the problem is a slowness of element conversion in polynomial rings:
{{{
sage: R1 = PolynomialRing(QQ,'x',10001)
sage: R2 = PolynomialRing(QQ,'x',10002)
sage: x10000 = R1('x10000')
sage: %time a = R2(x10000)
CPU times: user 4.96 s, sys: 0.12 s, total: 5.08 s
Wall time: 5.11 s
}}}
which is rather slow as well.",defect,closed,major,sage-4.3,commutative algebra,fixed,"infinite polynomial ring, basic arithmetic",,sage-4.3.alpha1,Simon King,Martin Albrecht,N/A,,,,,