From 2bbfd14c1b639205a83966d92b73d5329df87991 Mon Sep 17 00:00:00 2001 From: meehl <12648828+meehl@users.noreply.github.com> Date: Mon, 24 Aug 2026 10:48:31 +0200 Subject: [PATCH] Add profileing scope around `OnFrame` and remove mut ref to context --- src/pob.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pob.rs b/src/pob.rs index d9a0d16..1718d29 100644 --- a/src/pob.rs +++ b/src/pob.rs @@ -290,9 +290,12 @@ impl PathOfBuilding { self.handle_subscripts()?; - call_callback::<(), ()>(&self.lua, "OnFrame", ())?; + { + profiling::scope!("lua_OnFrame"); + call_callback::<(), ()>(&self.lua, "OnFrame", ())?; + } - let ctx = self.lua.app_data_mut::().unwrap(); + let ctx = self.lua.app_data_ref::().unwrap(); let (layers_hash, layers) = ctx.recorder.finish(); let identical = layers_hash == self.previous_layers_hash;