On speed.pypy.org there are two sympy benchmarks that peak out at over 2x CPython. Here is what helped:
- more iterations. The JIT is working out what to optimize, it just takes a while to do it
- (the mirror image) making tracing more eager.
So by running the benchmark with both those, we get quite close to CPython
PYTHONPATH=benchmarks/lib/sympy ./pypy3.12-c --jit trace_eagerness=20 \
benchmarks/own/bm_sympy.py --benchmark integrate -n 300 | datamash median 1 sstdev 1