On Nov 30, 2006, at 10:54 PM, William Stein wrote:
>> You need to try this last one again in pyrex, using a cdef int i for >> the loop counter, and doing the arithmetic with python ints; and then >> compare that to the same thing using SAGE Integers. > > OK, I've done that. But honestly, I don't know what it is really > timing, > since the optimizing compiler could be doing all kinds of interesting > things with unrolling loops, macros, etc. And it's really pretty > unfair, > since the point is optimizing an interpreter rather than a compiler. > With that benchmark though, object creation is basically 12 times > faster > for Python ints, though again I think one has to be careful in > intepreting > how these things mean, when we're really trying to benchmark an > interpreter > and the object-creation-overhead of that interpreter. I agree that the interpreter setting is important. But the compiled setting is important too. For example, if you write a pyrex function that operates on matrices, whose elements are arbitrary python objects, and you happen to give it a matrix with python ints as entries, it will go something like 12 times faster than if you had given it a matrix with SAGE ints. Well, not 12, but still probably significant. David --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] 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/ -~----------~----~----~----~------~----~------~--~---
