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


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/CADDwiVDf9OLX1H3dS2Ugnr1bH%2BX-Q_dOziwWGB7asUWDCvUJ4Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to