When using repeated iterations, do not store first iteration

Also set minimum iterations to 2
master
pullusb 2024-11-04 12:26:29 +01:00
parent ec45ebd2e2
commit cf7ffa8d60
2 changed files with 10 additions and 6 deletions

View File

@ -4,7 +4,7 @@ from . import modifier_profiling
bl_info = { bl_info = {
"name": "Profiling Buddy", "name": "Profiling Buddy",
"author": "Simon Thommes, Samuel Bernou", "author": "Simon Thommes, Samuel Bernou",
"version": (0, 2), "version": (0, 3),
"blender": (3, 5, 0), "blender": (3, 5, 0),
"location": "Properties > Modifier > Profiling Buddy", "location": "Properties > Modifier > Profiling Buddy",
"description": "Adds panels to profile execution times.", "description": "Adds panels to profile execution times.",

View File

@ -182,12 +182,16 @@ class PB_OT_evalulate(Operator):
## gather a list of all evaluated sessions ## gather a list of all evaluated sessions
for mod_eval in ob_eval.modifiers: for mod_eval in ob_eval.modifiers:
if i == 0:
tmp_dic[mod_eval.name] = []
t = mod_eval.execution_time t = mod_eval.execution_time
# print(i, mod_eval.name, t)
# wm['mod_timer'][mod_eval.name] = t # keep last evaluated time if i == 0:
# Initialize modifier dict time list
tmp_dic[mod_eval.name] = []
## Do not store first iteration, often less precise timing
continue
tmp_dic[mod_eval.name] += [t] tmp_dic[mod_eval.name] += [t]
wm.progress_update(i) wm.progress_update(i)
@ -213,7 +217,7 @@ class PB_OT_evalulate(Operator):
class PB_PG_modifiers_profiler(PropertyGroup): class PB_PG_modifiers_profiler(PropertyGroup):
evaluation_live : bpy.props.BoolProperty(name='Live Mode', default=True) evaluation_live : bpy.props.BoolProperty(name='Live Mode', default=True)
evaluations_count : bpy.props.IntProperty(name='Evaluations', default=5) evaluations_count : bpy.props.IntProperty(name='Evaluations', default=5, min=2)
progress : bpy.props.IntProperty(name='Progress', default=-1) progress : bpy.props.IntProperty(name='Progress', default=-1)
# subprogress : bpy.props.IntProperty(name='ModifierProgress', default=-1) # subprogress : bpy.props.IntProperty(name='ModifierProgress', default=-1)
# use_frame_set : bpy.props.BoolProperty(name='Set Frame At Each Iteration', default=True) # use_frame_set : bpy.props.BoolProperty(name='Set Frame At Each Iteration', default=True)