Hey, Mike,

Thanks for this...

On Sep 9, 2008, at 3:42 PM, Mike Hansen wrote:

> I'm not sure about the other stuff, but you should do "is None"
> instead of "== None" since your times are so low.
>
> sage: a = 2
> sage: timeit("a == None")
> 625 loops, best of 3: 420 µs per loop
> sage: timeit("a is None")
> 625 loops, best of 3: 143 ns per loop

Before:
sage: %timeit q.D1()
1000 loops, best of 3: 307 µs per loop

After:
sage: %timeit q.D1()
1000000 loops, best of 3: 647 ns per loop

That seems to have a positive effect. :-}

What's the difference between "==" and "is" (or, more to the point:  
where is this discussed)?

Justin

--
Justin C. Walker, Curmudgeon at Large
Director
Institute for the Enhancement of the Director's Income
-----------
Nobody knows the trouble I've been
-----------




--~--~---------~--~----~------------~-------~--~----~
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://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to