Re: [sage-devel] Re: weird difference in performance

2010-11-23 Thread William Stein
On Tue, Nov 23, 2010 at 11:37 AM, David Roe wrote: > I think that while we're still using Python 2.x, where 2r/3r = 0, we > absolutely need the preparser. Yes. Without it, it is far to easy to type something like x^3 + 2*x^2 - 1/2*x + 5/3 and having that give x^3 + 2*x^2 + 1 would be a tota

Re: [sage-devel] Re: weird difference in performance

2010-11-23 Thread William Stein
On Tue, Nov 23, 2010 at 11:37 AM, David Roe wrote: > I think that while we're still using Python 2.x, where 2r/3r = 0, we > absolutely need the preparser.  The coercion framework can work with Python > ints just fine: it's the automatic rounding that kills us.  Much better > speed for large intege

Re: [sage-devel] Re: weird difference in performance

2010-11-23 Thread David Roe
I think that while we're still using Python 2.x, where 2r/3r = 0, we absolutely need the preparser. The coercion framework can work with Python ints just fine: it's the automatic rounding that kills us. Much better speed for large integers is another benefit that you mentioned. Also, there are l

[sage-devel] Re: weird difference in performance

2010-11-23 Thread pang
Thanks ! I see there is a second issue then: when I used %run script.sage from the ipython console, there is no preprocessing. That's why there was "no penalty in the sage console". Of course, there is a penalty when running the script as in: sage script.sage BTW: how do you guys run scripts f

[sage-devel] Re: weird difference in performance

2010-11-23 Thread Dan Christensen
John Cremona writes: > There is a lesson to be learned here, which is in fact very similar to > one which William explained very well recently: beware the Sage > preprocessor which converts every integer it sees to an Integer, which > can have serious performance consequences and is often not ne