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

> If you're using the SAGE command prompt, it's important to either
> set the constants outside of the loop (they all get wrapped in
> Integer( ... ), which slows things down), or put an r after them
> to make them raw literals.    (We intend to automatically factor
> out setting of constants, but haven't implemented that yet.)

Yes, I was wrong.

sage -ipython (with SAGE's python) produces about the same timing as 
cygwin's python (as in Justin C. Walker's earlier reply)

In [4]: time a=m(201)
CPU times: user 0.02 s, sys: 0.00 s, total: 0.02 s
Wall time: 0.04

In [5]: time a=m(1001)
CPU times: user 0.88 s, sys: 0.00 s, total: 0.88 s
Wall time: 0.88

So what is the correct way to define m(n) in SAGE? Such things as m(201r) 
and m(1001r) work as slow as m(201) and m(1001),

sage: time a=m(201r)
CPU times: user 1.72 s, sys: 0.67 s, total: 2.39 s
Wall time: 2.51

sage: time a=m(1001r)
CPU times: user 47.06 s, sys: 20.03 s, total: 67.09 s
Wall time: 68.89

Alec





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