mirror of
https://github.com/cyberarm/cyberarm_engine.git
synced 2026-03-21 19:56:11 +00:00
Add StackProf hooks for profile recalculate
This commit is contained in:
@@ -68,3 +68,7 @@ require_relative "cyberarm_engine/game_state"
|
||||
require_relative "cyberarm_engine/ui/gui_state"
|
||||
|
||||
require_relative "cyberarm_engine/builtin/intro_state"
|
||||
|
||||
at_exit do
|
||||
StackProf.results("./_prof.txt") if RUBY_ENGINE != "mruby" && defined?(StackProf)
|
||||
end
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user