tdauth / wowr

Warcraft III: Reforged funmap World of Warcraft Reforged.
https://wowreforged.org
8 stars 0 forks source link

Improve performance by reducing periodic timers #2695

Open tdauth opened 3 months ago

tdauth commented 3 months ago

https://raw.githubusercontent.com/tdauth/wowr/master/wowr.w3x/war3map.j TimerStart(

Ignore all spell specific timers which are only enabled temporarily during the game.

call TimerStart(PagedButtons__autoUpdateStockTimer, 1.0, true, function s__PagedButtons_SlotType_timerFunctionUpdateTime)
call TimerStart(Crafting___itemCraftingStockUpdateTimer, Crafting_UPDATE_INTERVAL, true, function Crafting___TimerFunctionUpdateItemCraftingStocks)

      if GetLocalizedString("REFORGED") == "REFORGED" then
            call TimerStart(CreateTimer(), 1 / 32.0, true, function CustomConsoleUI__update)
        endif

call TimerStart(CreateTimer(), GetMainSelectedUnitForPlayer_SYNC_INTERVAL, true, function GetMainSelectedUnitForPlayer__TimerFunctionSync)

TimedHandles

call TimerStart(TurretSystem__TurretSystemUpdateTimer, TURRET_SYSTEM_UPDATE_INTERVAL, true, function TurretSystem__TurretSystemUpdate)

call TimerStart(s__CooldownReductionUtils__CDRUtils_t, 0.03125000, true, function s__CooldownReductionUtils__CDRUtils_onPeriod)
call TimerStart(ResourcesMultiboardGui__t, ResourcesMultiboardGui_TIMER_INTERVAL, true, function ResourcesMultiboardGui__TimerFunctionUpdate)

call TimerStart(WoWReforgedRacesUI___updateTimer, 0.03, true, function WoWReforgedRacesUI___TimerFunctionUpdateIdleWorkerIcons)

call TimerStart(s__AThirdPersonCamera_m_timer, s__AThirdPersonCamera_timeout, true, function s__AThirdPersonCamera_timerFunctionRefresh)
call TimerStart(KeyMovementSystem__UpdateTimer, KeyMovementSystem_TIMER_INTERVAL, true, function KeyMovementSystem__TimerFunctionUpdate)
call TimerStart(ResourcesLoadedMines__harvestTimer, ResourcesLoadedMines_HARVEST_INTERVAL, true, function ResourcesLoadedMines__TimerFunctionHarvest)
call TimerStart(TaxiSystem___passengerSpawnTimer, TaxiSystem_PASSENGER_SPAWN_RATE, true, function TaxiSystem___TimerFunction)
call TimerStart(AuraSystem___t, AuraSystem_TIMER_UPDATE_INTERVAL, true, function AuraSystem___TimerFunctionUpdateAuras)
call TimerStart(WoWReforgedBackpacks___BackpackPickupTimer, 0.05, true, function WoWReforgedBackpacks___TimerFunctionPickupItem)
call TimerStart(WoWReforgedBackpacks___BackpackUpdateLocationTimer, BACKPACK_MOVE_INTERVAL, true, function WoWReforgedBackpacks___TimerFunctionUpdateLocationsOfBackpackAndEquipmentBags)
tdauth commented 3 months ago

Consider AI scripts. UpdateWorkers is called every 10 seconds.

tdauth commented 3 months ago

Updating stats could be slow because of: Updating all icons, updating the boss heroes with the highest levels since the group is big? Maybe cache icons until repicks and cache heroes until level ups?