On Mon, Jul 20, 2015 at 7:48 PM, Ondřej Čertík <ondrej.cer...@gmail.com> wrote: > On Sun, Jul 19, 2015 at 4:57 PM, Jason Moore <moorepa...@gmail.com> wrote: >> I just tried this out with jacobian() and subs() over the commits since >> 0.7.3 to master. It's showing me that the new caching is the killer >> slowdown: >> >> https://github.com/sympy/sympy/commit/a63005e4 >> >> I've submitted a PR to Björn's repo: >> https://github.com/bjodah/sympy_benchmarks_bjodah/pull/1/files >> >> I'm assuming it uses fastcache because I have it installed, but maybe not. >> I'm not sure how to control for dependencies yet. > > I modified your benchmark to first do the substitution for symbols, > only then do the Jacobian: > > https://github.com/sympy/symengine/commit/2ababdb89e6c6db04d4a5df3e30185b824de9c0c > > Here are the results: > > certik@redhawk:~/repos/symengine/benchmarks(py)$ python kane2.py > Setup > Converting to SymEngine... > SymPy Jacobian: > Total time: 0.155253887177 s > SymEngine Jacobian: > Total time: 0.00277400016785 s > > Speedup: 55.97x > > > I played with the cache size, it makes no difference. Your original > benchmark ran about 1s on my machine, with SYMPY_CACHE_SIZE=5000 it > took about 0.9s. So you can speedup SymPy itself just by using symbols > instead of functions by a factor of 5.8x. Btw, I tested that the > result that I get from symengine is exactly the same as in sympy > (https://github.com/sympy/symengine/commit/2ababdb89e6c6db04d4a5df3e30185b824de9c0c#diff-e423f8edd8641c702513b2ea9c10eaecR32). > > > How did you generate the benchmark? Can you generate a bit larger > matrix? Once the symengine benchmark runs in about 1s, then I can try > to speed it up (because I would see the result in the timing more > easily).
I actually found a much larger benchmark, where just a simple differentiation of a single entry (after substituting functionsf or symbols) takes 60s for sympy. https://github.com/sympy/symengine/commit/31378da77e5463870b9a22fda7a17deb68068fa8 Here is where I am saving the matrix: https://github.com/sympy/symengine/commit/31378da77e5463870b9a22fda7a17deb68068fa8#diff-39829995ea91876984e13e3b828d740aR252 Does this make sense? Is that a good benchmark? I love the size, I just want to make sure I am saving the right thing. Is that the full bicycle? Ondrej -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscr...@googlegroups.com. To post to this group, send email to sympy@googlegroups.com. Visit this group at http://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CADDwiVDZ_JSgC-C_j5J0zmSOXS9TAQsGFv_XcmbBvx3ijPhPrg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.