On Fri, Dec 14, 2012 at 06:51:06PM -0800, Travis Scrimshaw wrote: > I ran %prun on the partitions of 150 and there is a large amount of time > spent in the infinity element constructor, calling isinstance, and the > rightmost_pivot.
Thanks for investigating this! If you feel like it, I am all in favor of a small patch taking care of the most urgent optimizations before we go for the full cythonization. I am not surprised by the results of your timings. In MuPAD we had done a similar optimization by using the infinite value of IEEE floats (and its negative); it was quite fast, and we did not even have to handle a special case. Could you give it a shot using the following? sage: float('inf') inf I got the pleasant surprise that Sage's infinity plays well with float('inf'): sage: float(infinity) inf sage: float('inf') == infinity False sage: float('inf') < infinity True sage: float('inf') > infinity False sage: float('-inf') < infinity True sage: float('-inf') > -infinity True Cheers, Nicolas -- Nicolas M. ThiƩry "Isil" <nthi...@users.sf.net> http://Nicolas.Thiery.name/ -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To post to this group, send email to sage-combinat-devel@googlegroups.com. To unsubscribe from this group, send email to sage-combinat-devel+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sage-combinat-devel?hl=en.