On 5 May 2012 20:56, Aaron Meurer <[email protected]> wrote: > I'm not sure about this. If you try commenting out the empty > __slots__ definition for AtomicExpr, for example, the core tests take > almost twice as long (41 seconds for me vs. 25 in master). It's not > clear why, though. Commenting out the __slots__ in Basic, which is > the only one that I know of that is non-empty, makes the tests take 28 > seconds, and commenting out the empty __slots__ for Expr makes them > take 38 seconds. > > But I imagine if we were to remove all __slots__ definitions in the > core, that things would be much slower. >
Almost rhetorical questions follow: It would be a great research task for Google Code In. But seriously, I really don't get that. Is a dictionary lookup so expensive in python? Any ideas about pypy? > > A lot of classes in the core have __new__ methods that return > Basic.__new__(cls, *args, **kwargs) (do a grep for Basic\.__new__ to > see what I mean). Any idea why this is done? > Maybe it is to have _hashable_content automatically updated with the stuff in _args and srepr&co automatically aware of the new arguments. I am not sure... -- You received this message because you are subscribed to the Google Groups "sympy" group. 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/sympy?hl=en.
