Hi!

I just found that part of the problem is coercion -- or actually
conversion -- for classical polynomial rings:

sage: R1 = PolynomialRing(QQ,'x',10001)
sage: R2 = PolynomialRing(QQ,'x',10002)
sage: x10000 = R1('x10000')
sage: %prun a = R2(x10000)
         160026 function calls in 5.073 CPU seconds

   Ordered by: internal time

   ncalls  tottime  percall  cumtime  percall filename:lineno
(function)
        1    4.849    4.849    5.073    5.073 <string>:1(<module>)
    20003    0.114    0.000    0.157    0.000 {built-in method sub}
    20003    0.035    0.000    0.045    0.000 re.py:229(_compile)
    20003    0.023    0.000    0.225    0.000 re.py:144(sub)
    20003    0.022    0.000    0.043    0.000 re.py:271(_subx)
    20003    0.013    0.000    0.020    0.000 re.py:251(_compile_repl)
    40006    0.013    0.000    0.013    0.000 {method 'get' of 'dict'
objects}
    20003    0.004    0.000    0.004    0.000 {isinstance}
        1    0.000    0.000    0.000    0.000 {method 'disable' of
'_lsprof.Profiler' objects}

This is too long, I think. And it is done behind the scenes when
multiplying 1/2*x10000 after creating x[10001] in your example.

Of course, this does not explain everything, but still it could be
worth while to improve.

My plan would now be to analyse your example further and then open
various tickets, also for the polynomial conversion.

Cheers,
Simon

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to