Le mardi 06 juillet 2010 à 21:56 -0700, Ondrej Certik a écrit :
> On Tue, Jul 6, 2010 at 4:51 PM, Ronan Lamy <ronan.l...@gmail.com> wrote:
> > Le mardi 06 juillet 2010 à 11:19 -0700, Ondrej Certik a écrit :
> >> Yeah, that's right. It's still faster though:
> >
> > OK, then I guess using expr.func(*some_list) instead of
> > expr.new(*some_list) helps. We could probably even gain a bit more by
> > having a Basic.from_iterable classmethod and doing
> > expr.from_iterable(some_list).
> 
> Either is fine with me.
> 
I've tried the from_iterable idea and it doesn't seem very useful and
makes code slightly less readable. OTOH, most expr.new <- expr.func
replacements from your branch could be applied on master.

> >>
> >> > why you expect to see any kind of speedup, since the old assumption
> >> > system is fast and efficient.
> >>
> >> I disagree.
> >>
> > Why?
> 
> The old assumptions make it impossible to speedup the core. You wrote
> that you don't see "why it would require the new assumptions." The
> answer to that is that with the current old assumptions, attached to
> symbols, it's not possible to make it as fast as ginac or Sage (for
> example), because you have to worry about assumptions each time you
> construct an expression.
> 
I don't understand why you "have to worry about assumptions each time
you construct an expression". Expressions don't actually have
assumptions in the old system. Actually, one of the best features of the
new system is that it promises to allow assumptions to be attached to
expressions.

> Well, technically, you might say, that it might, theoretically be
> somehow possible, but in practice, we have a nice new core, written in
> python and cython and it is comparable to ginac. It doesn't use
> assumptions. And I don't know any fast way to implement the old
> assumptions in there, without drastically slowing it down. Nor anyone
> else has produced any code to show that.

OK but the new core doesn't actually work, in the sense that there
exists a branch which can be rebased on master and where all tests pass.
I think it's unwise to throw away code that actually works for the sake
of code that doesn't.
> 
> >
> >> > 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.
> >>
> > I don't think that making sympy slower and harder to use is an
> > improvement.
> 
> I don't understand this statement. As I showed above, the new branch
> makes sympy *faster*, and also easier to use, because the core doesn't
> need assumptions attached to symbols, so it will be possible to use
> our fast core.
> 
The new branch makes sympy slightly faster in some cases but
significantly slower overall. Forcing users to add boilerplate code
every time they use symbols and to remember to properly manage
assumptions' lifetimes does IMO make sympy harder to use.

> For some things, it is currently slower and I need to investigate it
> and fix it. It is related to caching, because if basic arithmetic is
> faster, then everything can be as fast or faster.
> 
> > As for the new core, I don't see why we need a new one nor
> 
> SymPy is currently about 10x to 100x slower than Sage or ginac. Except
> polynomials, where Mateusz is not using the core at all, so that's
> unrelated.
> 
> For many people, the current speed is enough (including you I think)
> and that's absolutely ok, I am very happy about that. Howerver, for
> many people the speed is not enough and it's basically a show stopper
> for them to consider sympy seriously. My goal is to fix this.
> 
> > why it would require the new assumptions.
> 
> I answered to this above.
> 
> >
> >> 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?
> >
> > I'll try to get my Predicate branch in soon.
> 
> Thanks, that'd be cool.
> 
> Howerver, my goal is to get the fast core into sympy, so that sympy is
> by default as fast as Sage. Assumptions is just one step on the road.
> 
> 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.

Reply via email to