From 7ba168f7dad84c549e3ca209b71f80bb0adeb4fd Mon Sep 17 00:00:00 2001 From: Meow <30401521+me0wg4ming@users.noreply.github.com> Date: Mon, 19 Jan 2026 03:40:53 +0100 Subject: [PATCH] nameplates performance fix nameplates performance fix --- modules/nameplates.lua | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/modules/nameplates.lua b/modules/nameplates.lua index ec2ccc02..18c1b159 100644 --- a/modules/nameplates.lua +++ b/modules/nameplates.lua @@ -978,11 +978,22 @@ pfUI:RegisterModule("nameplates", "vanilla", function () nameplates.OnUpdate = function(frame) local frame = frame or this local nameplate = frame.nameplate - local now = GetTime() -- Cache GetTime() once per update + local now = GetTime() - -- OPTIMIZED: Smooth updates for castbars and targeting + -- Performance: Skip invisible frames immediately + local isVisible = frame:IsVisible() + if not isVisible then return end + + -- Intelligent throttling based on target/castbar status local target = UnitExists("target") and frame:GetAlpha() >= 0.99 or nil - local throttle = target and 0.02 or 0.025 -- Target: 50 FPS, Non-Target: 20 FPS + local isCasting = nameplate.castbar and nameplate.castbar:IsShown() + + local throttle + if target or isCasting then + throttle = 0.02 -- 50 FPS for target OR active castbar + else + throttle = 0.1 -- 10 FPS for others (healthbar updates) + end if (nameplate.lasttick or 0) + throttle > now then return end nameplate.lasttick = now