I recently discovered some software called scalene that is supposed to examine the efficiency of your python code. I managed to get it to work with a simple "stand alone" python script which I show below:
from scalene import scalene_profiler
scalene_profiler.start()
for i in [1,2,3,4,5,6,7,8,9]:
print(i*10)
scalene_profiler.stop()
You get scalene to work by running it from command line, this I show below:
C:\Users\hornb\AppData\Local\ESRI\conda\envs\arcgispro-py3_Spyder>python.exe -m scalene C:\Scratch\testscalene.py
I'm developing some rather meaty python tools that are embedded in an atbx toolbox which require the user to run the tools from within ArcPro as they need to choose layers from a map. I've not used a profiler before and can't see a way to use it if the python code is embedded in a toolbox and you some how need to call scalene from a command line prompt.
I was wondering if any ArcPro python developers out there have tried to use such software and got any advice\pointers\pearls of wisdom?