Not 100% clear on this: are the times for the entire example code(6:20
-> 0:42, meaning printing times were 5:50 -> 0:12) or just the
printing line?
Printing with "unsorted" certainly messes up the order of the outputs,
so avoiding it while printing large expressions could be beneficial.
If you could explain what you mean by caching sort_key, I'd like to
see how well these two options scale (for something, say, 10 times
longer than the previous expressions I experimented with).
Did you just put @cacheit in front of Basic's sort_key() definition?

-Gilbert



On Aug 26, 8:30 am, Aaron Meurer <asmeu...@gmail.com> wrote:
> By the way, perhaps we should play with caching sort_key.  On my
> machine, it brought down the printing time for your example from 6
> min. 20 sec. to 42 sec.
>
> On the other hand, in a merge of your large_printing branch and your
> pydy branch, with the option {'order':"unsorted"} added to your
> printer, it takes 34 seconds.
>
> And by the way, 30 seconds is just the setup time. The rest is the
> actual printing.
>
> Aaron Meurer
>
>
>
>
>
>
>
> On Sat, Aug 20, 2011 at 11:17 PM, Gilbert gede <gilbertg...@gmail.com> wrote:
> > Ok, I started a branch on my github fork (large_printing). I made
> > changes to LatexPrinter, StrPrinter, and PrettyPrinter's _print_Mul
> > and _print_Add methods.
> > My custom printer inherited those changes as well, and now with that
> > setting, print my large expressions quickly.
>
> > I also opened a pull request for this.
>
> > -Gilbert
>
> > On Aug 20, 9:34 am, Aaron Meurer <asmeu...@gmail.com> wrote:
> >> We already have function interfaces to all the printers.  The str
> >> printer is accessed via sstr(), for example, so for this case, it
> >> would be an option to that function.
>
> >> I think an unsorted option would be useful.  Please also do it for the
> >> other printers, and add a note do the docstring(s) noting that it can
> >> be used to increase the speed of printing large expressions.
>
> >> Aaron Meurer
>
> >> On Fri, Aug 19, 2011 at 10:42 PM, Chris Smith <smi...@gmail.com> wrote:
> >> > On Sat, Aug 20, 2011 at 10:06 AM, Gilbert gede <gilbertg...@gmail.com> 
> >> > wrote:
> >> >> So in _print_Add I changed the first line of the method from
> >> >>    terms = self._as_ordered_terms(expr, order=order)
> >> >> to
> >> >>    terms = expr.args
> >> >> and in _print_Mul changed:
> >> >>    if self.order != 'old':
> >> >>        args = expr._new_rawargs(*terms).as_ordered_factors()
> >> >>    else:
> >> >>        args = terms
> >> >> to
> >> >>    args = terms
>
> >> >> Doing this took the time for printing those large expressions from
> >> >> minutes to a few seconds. I think I'll add an 'unsorted' option in the
> >> >> main SymPy string printer- does this sounds like an agreeable idea?
>
> >> > But how would a user call it? Should we have an rprint (raw print)
> >> > function that uses the unsorted option?
>
> >> > --
> >> > You received this message because you are subscribed to the Google 
> >> > Groups "sympy" group.
> >> > To post to this group, send email to sympy@googlegroups.com.
> >> > To unsubscribe from this group, send email to 
> >> > sympy+unsubscr...@googlegroups.com.
> >> > For more options, visit this group 
> >> > athttp://groups.google.com/group/sympy?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "sympy" group.
> > To post to this group, send email to sympy@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > sympy+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/sympy?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sympy@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