thanks for verifying it. Which particular benchmark shows 5x speedup? The bicycle one? Yes, I noticed significant slowdown in Sage due to the Python calls --- it's actually really hard to make sure there is no slowdown coming from the Python wrappers. This is the reason why I decided to just stick to C++ and actually make the Python wrappers optional. That way all this Python complexity goes off the table, you don't have to worry about it at all, we just need to make sure the C++ code itself is performing. That's why I benchmark it against ginac itself, which is also raw C++ and symengine seems to be a bit faster, depending on the benchmark. Then, we still want to be able to provide a Python class (e.g. some kind of special function implemented in Python) and use it in C++. We do that using FunctionWrapper
which is just a C++ class where the user can provide a simple C callback to do things. And the Python wrappers then hook in a Python callback. Of course this will then be slow, but it's possible, and the C++ code itself doesn't care about Python.