5.1. Profiling About
Trace Profiling
Sampling Profiling
https://docs.python.org/3.15/whatsnew/3.15.html#tachyon-high-frequency-statistical-sampling-profiler
5.1.1. Tools
python -m profile myfile.py(deprecated)python -m cProfile myfile.pyTracing profilers record every function call and return, which can be very slow and produce large amounts of data.
Sampling profilers take periodic samples of the program's state, which is less intrusive and produces smaller amounts of data.
https://docs.python.org/dev/whatsnew/3.14.html#pep-768-safe-external-debugger-interface-for-cpython
https://docs.python.org/dev/howto/perf_profiling.html#perf-profiling
https://docs.python.org/dev/library/sys.monitoring.html#module-sys.monitoring
https://creators.spotify.com/pod/profile/corepy/episodes/The-Megahertz-e35ffoi