Add StackProf hooks for profile recalculate

This commit is contained in:
2026-01-08 22:16:54 -06:00
parent 498cf06916
commit 0fac4a0397
3 changed files with 7 additions and 1 deletions

View File

@@ -224,7 +224,7 @@ module CyberarmEngine
update_child_element_visibity(child)
end
puts "TOOK: #{Gosu.milliseconds - t}ms to recalculate #{self.class}:0x#{object_id.to_s(16)}'s #{@children.count} children"
puts "TOOK: #{Gosu.milliseconds - t}ms to recalculate #{self.class}:0x#{object_id.to_s(16)}'s #{@children.count} children" if is_root?
update_background

View File

@@ -66,7 +66,9 @@ module CyberarmEngine
if @pending_recalculate_request
Stats.frame.start_timing(:gui_recalculate)
StackProf.start(mode: :wall) if RUBY_ENGINE != "mruby" && defined?(StackProf)
@root_container.recalculate
StackProf.stop if RUBY_ENGINE != "mruby" && defined?(StackProf)
@pending_recalculate_request = false