On Tue, Jul 6, 2010 at 11:09 AM, Ronan Lamy <ronan.l...@gmail.com> wrote: > Le mardi 06 juillet 2010 à 09:27 -0700, certik1 a écrit : >> Hi, >> >> Christian has done a really awesome job and made almost all tests pass >> in his remove assumptions branch, and I have squashed my commits a >> little bit: >> >> git://github.com/certik/sympy.git remove_assumptions >> >> I did some tests and so far it got faster (!) for simple arithmetics (as >> I hoped). This is awesome. Try for example this script: >> >> from timeit import default_timer as clock >> from sympy import var >> var("x y z") >> a = (x+y+z+1)**20 >> c = clock() >> b = a.expand() >> c = clock() - c >> print c >> >> >> and then run it on master: >> >> ond...@raven:~/repos/sympy(master)$ python a.py >> 1.28675508499 >> ond...@raven:~/repos/sympy(master)$ python a.py >> 1.28236508369 >> ond...@raven:~/repos/sympy(master)$ python a.py >> 1.28870820999 >> ond...@raven:~/repos/sympy(master)$ python a.py >> 1.27885198593 >> >> >> and on the remove_assumptions branch: >> >> ond...@raven:~/repos/sympy(remove_assumptions)$ python a.py >> 1.12974405289 >> ond...@raven:~/repos/sympy(remove_assumptions)$ python a.py >> 1.12417292595 >> ond...@raven:~/repos/sympy(remove_assumptions)$ python a.py >> 1.15522003174 >> ond...@raven:~/repos/sympy(remove_assumptions)$ python a.py >> 1.12961602211 >> > >From what I can see, the difference comes mostly from yesterday's commit > adding __hash__ methods everywhere py3k needs it - you should try to > rerun your tests after 'git co master~3'. Actually, I don't understand
Yeah, that's right. It's still faster though: ond...@raven:~/repos/sympy((8d42c58...))$ python a.py 1.15458202362 ond...@raven:~/repos/sympy((8d42c58...))$ python a.py 1.17444515228 ond...@raven:~/repos/sympy((8d42c58...))$ python a.py 1.15918278694 ond...@raven:~/repos/sympy((8d42c58...))$ python a.py 1.15419101715 ond...@raven:~/repos/sympy((8d42c58...))$ python a.py 1.16285014153 ond...@raven:~/repos/sympy((8d42c58...))$ python a.py 1.17001891136 ond...@raven:~/repos/sympy((8d42c58...))$ git co remove_assumptions Previous HEAD position was 8d42c58... Import all() from sympy.utilities.iterables in sympy/core/operations.py Switched to branch 'remove_assumptions' ond...@raven:~/repos/sympy(remove_assumptions)$ python a.py 1.12777400017 ond...@raven:~/repos/sympy(remove_assumptions)$ python a.py 1.13791680336 ond...@raven:~/repos/sympy(remove_assumptions)$ python a.py 1.12641191483 ond...@raven:~/repos/sympy(remove_assumptions)$ python a.py 1.12735199928 > why you expect to see any kind of speedup, since the old assumption > system is fast and efficient. I disagree. > > >> So this is great news. We started this a little back with older master, >> so we need to rebase this on top of the latest master, and then fix some >> remaining little (?) problems with caching, which is causing some tests >> to run too long. I think we should try to remove caching completely, I >> think it just slows things down in most cases (according to my >> experience), but we'll see. >> > Caching is *very* useful for everything but the most trivial > computations. You just have to run the test suite with caching disabled > to see the huge difference it makes. Sure, it has its overhead, but it's > clearly worth it. > > Apart from this, I can see 2 problems with your branch: > * There is way too much boilerplate required whenever you want to work > with symbols. Replacing the Assume thingies with Predicates would help a > little but still not enough. Maybe Vinzent's "local assumptions" hack > could be a solution?? > * The new assumption system hasn't so much replaced the old one as been > wedged into it. As a result, there are basically two separate assumption > system, coded separately: obj.is_integer vs. Q.integer(obj). On general > principles, that sort of code duplication is wrong, and here it raises > many issues such as which one to use in a given situation or how to make > sure that their results aren't contradictory. Those are valid concerns, but it's an improvement over the current master. And it's a necessary step to get the new core in. Would you be willing to take a lead and get your branch, or Vinzent branch in, so that we can get the new core in? Unless I can see someone do that, I am going to continue in our current approach, as that will get things done. Ondrej -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sy...@googlegroups.com. To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.