PyneCore can now show you where a backtest spends its time

When a backtest runs slower than expected, you can now find the reason. Run it with the profile option and PyneCore prints the lines of your strategy that cost the most time, with how often each one ran and what share of the script’s time it took. A full profile is also saved to a file.

The time also gets split between your own code, the libraries you call, the engine, data loading and output, so you can see whether the slowness is in your logic or around it. Strategies that use request.security are covered too: every other symbol or timeframe they pull in is measured on its own, with its own lines and its own running time. That is usually where the surprises are.

The profiler watches the run from the outside, so the strategy you measure is the same one you trade. It needs Python 3.13 or newer.