On Tue, Jan 17, 2012 at 1:21 PM, Simon King <simon.k...@uni-jena.de> wrote:
> Hi Robert
>
> On 17 Jan., 22:10, Robert Bradshaw <rober...@math.washington.edu>
> wrote:
>> In particular, what I was
>> thinking is that a coercion or action involving R and S would have a
>> lifetime of min(lifetime(R), lifetime(S)) and not keep R or S alive.
>> If R + S -> R', then this action would keep R' alive, and once R or S
>> were reallocated R' would be as well (assuming it wasn't referenced
>> elsewhere).
>
> Yes, that is what I am aiming at.
>
>> What's the slowdown for ZZ * RDF for this patch?
>
> Do you mean "how long does it take to get the multiplication action of
> ZZ on RDF out of the cache", or "how long does it take to multiply an
> integer with a real"?

Both, but primarily the latter. It's a microbenchmark, but loop like

a = Integer(10)
b = QQ(20)
s = RDF(30)
for x in range(10**n):
    s += a*b*x

should give us an upper bound on how expensive any changes could be.
(And yes, people write code like this...) Maybe a similar test with a
tower of small finite fields. The impact could be greater for more
complicated rings, but the relative impact probably smaller.

- Robert

-- 
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