These are chat archives for symengine/symengine

8th
Aug 2015
Ondřej Čertík
@certik
Aug 08 2015 02:07
@isuruf would you mind regenerating the spkgs?
Ralf Stephan
@rwst
Aug 08 2015 12:21
@isuruf : hi, I'm the current Pynac maintainer (yes there is one atm). As to your gsoc page I hope you have done your own benchmarking instead of taking the numbers on the sage wiki for granted. If so there is still a catch: callgrind recently told me Pynac's contribution is <1% most of the time so Pynac is not the problem. Still, I'm supportive of your project, not least for the prospect to reduce Sage dependence on Maxima.
Ondřej Čertík
@certik
Aug 08 2015 14:53
@rwst we benchmark directly against ginac (i.e. C++ vs C++, no Python), see e.g. https://github.com/sympy/symengine/blob/604a6b1a6de9bbd562ec7b717b495899f5688119/benchmarks/expand2_ginac.cpp, to avoid any possible overhead in Pynac or the Python wrappers. Then we also test some benchmarks in Python itself (in or outside of Sage) against Sage in Python, see e.g. https://github.com/sympy/symengine/blob/604a6b1a6de9bbd562ec7b717b495899f5688119/benchmarks/expand2.py and https://github.com/sympy/symengine/blob/604a6b1a6de9bbd562ec7b717b495899f5688119/benchmarks/expand2_sage.py, but we understand that those can have overhead. Is the latest pynac as fast as the latest ginac?
@rwst our goal is to have the fastest library in C++, and we mainly concentrate on that. Then we want to try make Sage eventually use it (and if people like it, we would love if it becomes the default, but that's a very long run), as well as eventually port SymPy on top (also a very long run), and also have wrappers to other languages, we currently do Python, Ruby and Julia (it'd be cool to also do R, and perhaps also Maple and Mathematica itself). The idea is that if we can make all these communities use the same C++ library, then everybody can help with the development, and it benefits everybody.
Ondřej Čertík
@certik
Aug 08 2015 15:05
@rwst when you said that only <1% is Pynac, did you mean the Python wrappers in Pynac? Can you benchmark pynac on the C++ level, without the Python overhead?
Ralf Stephan
@rwst
Aug 08 2015 15:30
Callgrind collected data that can be presented by kcachegrind in a view summing up all the times that Sage spent in specific libraries. Consistently libpynac (C++) was between 0 and (rarely) 3 per cent. It may well be that symengine is faster but, if I interpret this right it won't matter for Sage.
Ralf Stephan
@rwst
Aug 08 2015 16:45
However it might be possible that symengine does fewer calls to Python, and so make Sage faster than Sage+Pynac. Needs benchmarking of its Python calls to make a guess.
Isuru Fernando
@isuruf
Aug 08 2015 16:51
@rwst, I ran the benchmarks on my computer for all 5 cases, SymEngine - C++, GiNaC, Sage, SymPy and SymEngine - Python.
Yes, that might indeed be the case. For eg: when dealing with integers, Pynac goes through Python for sage Integer class. That introduces overhead right?
Ralf Stephan
@rwst
Aug 08 2015 18:15
@isuruf yes but no idea how much atm
Isuru Fernando
@isuruf
Aug 08 2015 18:32
@rwst, how do you run callgrind on a sage program. valgrind --tool=callgrind sage -python expand2_sage.py doesn't seem to work
Francesco Biscani
@bluescarni
Aug 08 2015 18:38
@isuruf IIRC it depdends whether sage is a real executable or just a script that calls some other executable... E.g., on my machine python is a script that calls /usr/bin/python2.7 and in order to use valgrind I need to explictly call the full executable
Isuru Fernando
@isuruf
Aug 08 2015 19:48
Thanks for the suggestion. Called the command from a sage shell so that the executable is called. Works fine
Ralf Stephan
@rwst
Aug 08 2015 19:57
You need to start callgrind after Sage initialization. I'm not on my machine right now sorry.
Isuru Fernando
@isuruf
Aug 08 2015 20:01
Can you please describe how to do that when you are free?