ETrombly posted a great Python profiling tutorial with example in the forum https://forum.freecadweb.org/viewtopic.php?f=10&t=44785 Edit: props to @Russ4262 who mentioned this in https://github.com/FreeCAD/FreeCAD/issues/6092#issuecomment-1090970392