On Sat, May 5, 2012 at 7:56 PM, Ronan Lamy <[email protected]> wrote:
> Le samedi 05 mai 2012 à 12:56 -0600, Aaron Meurer a écrit :
>> 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.
>
> When I remove __slots__, I don't see any meaningful difference. Either
> something's very different between Mac and Ubuntu, or your timings are
> bogus. Considering that they are very erratic, I guess it's the latter.

I think perhaps the test in test_args that searches through all files
may be messing up the timings.  So I temporarily removed that file.
Even so, I get variations of up to 20 seconds even in master, so it's
hard to say.  I ran the core tests (./bin/test core) in master three
times, and got 29.00, 42.10, and 27.13 seconds. I commented out
__slots__ for AtomicExpr and ran the core tests three times and got
55.91, 48.94, and 39.44.  So I don't know. There definitely seems to
be a pattern of no __slots__ being slower.  The gross variations on my
computer are probably due to the fact that I have more than a dozen
other programs running at the same time, and the fact that my hard
disk is slow enough to make a huge difference whether the data happens
to be in memory or not.

I wish we had a working benchmark system (and not just a working one,
but one with up-to-date benchmarks).  Comparing timings of tests
doesn't seem very helpful.  Can you suggest something that might take
more time without __slots__ that I can test?

And as I asked on the other thread, is there a good reason to not have
__slots__?  It's just one line, and since they are all empty, it
doesn't really seem to cause any issues.  (sorry if I've asked this
before, I forgot the answer)

Aaron Meurer

>
>> But I imagine if we were to remove all __slots__ definitions in the
>> core, that things would be much slower.
>
> If a class doesn't have __slots__, __slots__ declarations in its
> subclasses have no effect. So if you remove __slots__ from Basic, it's
> basically as if you'd removed it from everywhere.

-- 
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.

Reply via email to