"William Stein" <[EMAIL PROTECTED]> writes:

> On 5/16/07, Michel <[EMAIL PROTECTED]> wrote:
>>
>> Consider
>>
>> sage: x,y,z=QQ['x','y','z'].gens()
>> sage: u,v,w=W['u','v','w'].gens()
>
> Syntax error -- W is not defined.  What is W?
>
>> sage: %timeit ((x+y+z)**3)(1/y,y,y**100)
>> 10 loops, best of 3: 752 ms per loop    <=== look here!
>> sage: %timeit ((u+v+w)**3)(1/v,v,v**100)
>> 10 loops, best of 3: 48.2 ms per loop  <=== look here!
>>
>> Conclusion: rational functions over the rationals are unusably slow at
>> this time.
>> I even know what the reason is. Rational functions over W do not
>> support reduce so it
>> is not called during the intermediate computations which happens to be
>> a blessing.
>>
>> William: I know you can easily fix this yourself.  If you are too busy
>> would you be interested in a patch? I think this kind of janitorial
>> work is important to improve the predictability
>> of sage behaviour.
>
> It's not at all clear to me without further discussion and benchmarking
> what the right optimization is so that rational functions over fields are
> sufficiently fast.  I definitely wouldn't make any changes
> to this without some discussion.  Basically, are you suggesting that one
> not call reduce until, e.g., printing?  Or at least until some sort of
> operations that require the thing be reduced?  When do you want
> to call reduce?

You can't let things pile up indefinitely; this was a problem with
quotient fields that was fixed a while back.  The intermediate values
get large, especially when powering, so that the final reduce is
ridiculously expensive.  I'm not certain what the right behaviour is,
but I don't like the idea of trying to have tricky behaviour to reduce
only at the right moment.  Always or never, I say.

Nick

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to