From 205589c2252c95ca88676902391cef6dde098d6d Mon Sep 17 00:00:00 2001 From: Meow <30401521+me0wg4ming@users.noreply.github.com> Date: Wed, 7 Jan 2026 23:39:43 +0100 Subject: [PATCH] performance improvement Implemented throttle to update nameplates of non-targets to 0.2 times per second and target to 0.05 seconds --- modules/nameplates.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/nameplates.lua b/modules/nameplates.lua index 1835b99a..6f69fc96 100644 --- a/modules/nameplates.lua +++ b/modules/nameplates.lua @@ -878,12 +878,19 @@ pfUI:RegisterModule("nameplates", "vanilla", function () end nameplates.OnUpdate = function(frame) - local update local frame = frame or this local nameplate = frame.nameplate + + -- Throttle: Update target more frequently than other nameplates + local target = UnitExists("target") and frame:GetAlpha() == 1 or nil + local throttle = target and 0.05 or 0.2 + + if (nameplate.lasttick or 0) + throttle > GetTime() then return end + nameplate.lasttick = GetTime() + + local update local original = nameplate.original local name = original.name:GetText() - local target = UnitExists("target") and frame:GetAlpha() == 1 or nil local mouseover = UnitExists("mouseover") and original.glow:IsShown() or nil local namefightcolor = C.nameplates.namefightcolor == "1"