Profiling¶
In Python, the operation of verifying whether a specific example x belongs to S is efficient when S is declared as a set and is inefficient when S is declared as a list.
Using PyPy, Numba or similar tools to compile your Python code into fast, optimized machine code.
cProfile¶
Use cProfile package in Python to find inefficiencies in your code.
But generally it's more convenient to run the code once and save the results to a file. Then do the analysis later.cProfile and pstats¶
cProfile and snakeviz¶
SnakeViz has two visualization styles, 'icicle' and 'sunburst'.
Linux¶
https://stackoverflow.com/questions/51982417/pandas-mask-where-methods-versus-numpy-np-where