Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 1.05 KB

Profiling.md

File metadata and controls

39 lines (28 loc) · 1.05 KB

Profiling

Description

Profiling the code of FreeCAD helps find bottlenecks in the algorithms used to create or manipulate objects.

To profile Python code use the standard

import cProfile
pr = cProfile.Profile()
pr.enable()

# 
# Lines of code that you want to profile
# 

pr.disable()
pr.dump_stats("/tmp/profile.cprof")

Then install and use

pyprof2calltree -i /tmp/profile.cprof -o /tmp/callgrind.out

Then visualize this information with

kcachegrind /tmp/callgrind.out

Resources


documentation index > [Developer Documentation](Category_Developer Documentation.md) > [Python Code](Category_Python Code.md) > Profiling