|
|
@@ -290,6 +290,7 @@ class ExecuteNodeTree(Operator):
|
|
|
sortby = SortKey.TIME
|
|
|
if 'cum' in environ.get("DOPROFILE").lower():
|
|
|
sortby = SortKey.CUMULATIVE
|
|
|
+ profile_function = environ.get("PROFILE_FUNCTION")
|
|
|
printme1 = ''
|
|
|
with cProfile.Profile() as pr:
|
|
|
tree.update_tree(context, error_popups = pass_error)
|
|
|
@@ -297,8 +298,9 @@ class ExecuteNodeTree(Operator):
|
|
|
s1 = io.StringIO()
|
|
|
ps1 = pstats.Stats(pr, stream=s1).strip_dirs().sort_stats(sortby)
|
|
|
ps1.print_stats(30) # print the top 20
|
|
|
- # ps1.print_callers("is_signature_in_other_signature")
|
|
|
- # ps1.print_callees("is_signature_in_other_signature")
|
|
|
+ if profile_function:
|
|
|
+ ps1.print_callers(profile_function)
|
|
|
+ ps1.print_callees(profile_function)
|
|
|
printme1 += s1.getvalue()
|
|
|
printme1 += f"Total profiled time: {ps1.total_tt:.6f} seconds"
|
|
|
with cProfile.Profile() as pr:
|
|
|
@@ -307,8 +309,9 @@ class ExecuteNodeTree(Operator):
|
|
|
s = io.StringIO()
|
|
|
ps = pstats.Stats(pr, stream=s).strip_dirs().sort_stats(sortby)
|
|
|
ps.print_stats(30) # print the top 20
|
|
|
- # ps.print_callers("is_signature_in_other_signature")
|
|
|
- # ps.print_callees("is_signature_in_other_signature")
|
|
|
+ if profile_function:
|
|
|
+ ps.print_callers(profile_function)
|
|
|
+ ps.print_callees(profile_function)
|
|
|
print (printme1)
|
|
|
print(s.getvalue())
|
|
|
print(f"Total profiled time: {ps.total_tt:.6f} seconds")
|