-
-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reserve time for each action in login thread #5174
base: main
Are you sure you want to change the base?
Conversation
An experimental build of WeakAuras with the changes in this pull request is available here. |
I tested the experimental build and I keep getting the same error
Locals: HandleGlowAction = defined @WeakAuras/WeakAuras.lua:3619 frame_strata_types = } DisplayToString = defined @WeakAuras/Transmission.lua:357 combat_event_type = } regions = } frameLevels = } CheckItemSlotCooldowns = defined @WeakAuras/GenericTrigger.lua:3166 InitializeEncounterAndZoneLists = defined @WeakAuras/Types_Cata.lua:13 IsEnvironmentInitialized = defined @WeakAuras/AuraEnvironment.lua:200 form_types = } CleanArchive = defined @WeakAuras/History.lua:25 UpdateProgressFrom = defined @WeakAuras/RegionTypes/RegionPrototype.lua:567 RunConditions = defined @WeakAuras/Conditions.lua:840 tooltip_count = } SmoothStatusBarMixin = } pet_spec_types = } regionOptions = } get_zoneId_list = defined @WeakAuras/Types_Cata.lua:75 checkForSingleLoadCondition = defined @WeakAuras/Prototypes.lua:1224 author_option_classes = } grid_types = } non_transmissable_fields = } absorb_modes = } combatlog_spell_school_types_for_ui = } miss_types = } CancelDelayedTrigger = defined @WeakAuras/GenericTrigger.lua:944 centered_types_h = } ensurePRDFrame = defined @WeakAuras/WeakAuras.lua:5437 talent_types = } LoadFunction = defined @WeakAuras/AuraEnvironment.lua:652 reset_swing_spells = } spec_types_all = } player_target_events = } FinishLoadUnload = defined @WeakAuras/WeakAuras.lua:2067 subRegionTypes = } UnregisterAllEveryFrameUpdate = defined @WeakAuras/GenericTrigger.lua:1884 array_entry_name_types = } eclipse_direction_types = } StringToTable = defined @WeakAuras/Transmission.lua:301 RegisterLoadEvents = defined @WeakAuras/WeakAuras.lua:1913 GetReputationsSorted = defined @WeakAuras/Types.lua:1712 blend_types = } text_automatic_width = } EnforceSubregionExists = defined @WeakAuras/RegionTypes/RegionPrototype.lua:1125 CheckSpellCooldown = defined @WeakAuras/GenericTrigger.lua:3022 custom_trigger_types = } group_types = } subRegionOptions = } GetProgressValueConstant = defined @WeakAuras/WeakAuras.lua:3930 text_rotate_types = } spec_types = } anim_ease_types = } item_slot_types = } multiUnitUnits = } anim_color_types = } loaded = } Convert = defined @WeakAuras/WeakAuras.lua:2284 sound_channel_types = } CheckCooldownReady = defined @WeakAuras/GenericTrigger.lua:3224 event_prototypes = } NeedToRepairDatabase = defined @WeakAuras/WeakAuras.lua:2361 AtlasList = } RegisterRegionType = defined @WeakAuras/WeakAuras.lua:413 classification_types = } GetCurrencyListSize = defined =[C]:-1 unit_types_bufftrigger_2 = } IsOptionsProcessingPaused = defined @WeakAuras/WeakAuras.lua:1589 ValueFromPath = defined ` |
I tested the last artifact and got an error again
Locals: login = } finish = 276505524.720800 defaultEstimate = 1000 start = 276490524.721600 estimates = login = 5 } ok = true val = 5 continue = true (for generator) = defined =[C]:-1 (for state) = login = } (for control) = "login" name = "login" thread = estimate = 5 (*temporary) = true (*temporary) = 5 (*temporary) = true (*temporary) = 5 (*temporary) = true (*temporary) = "script ran too long" debugprofilestop = defined =[C]:-1 debugstack = defined =[C]:-1 threads = normal = } SetPriority = defined @WeakAuras/WeakAuras.lua:4338 instant = } urgent = } Remove = defined @WeakAuras/WeakAuras.lua:4348 Immediate = defined @WeakAuras/WeakAuras.lua:4395 Add = defined @WeakAuras/WeakAuras.lua:4324 background = } frame = Frame { } prios = } size = 1 }` |
WeakAuras/WeakAuras.lua
Outdated
@@ -2615,7 +2599,7 @@ function Private.AddMany(tbl, takeSnapshots) | |||
oldSnapshots[data.uid] = Private.GetMigrationSnapshot(data.uid) | |||
end | |||
Private.SetMigrationSnapshot(data.uid, data) | |||
coroutine.yield() | |||
coroutine.yield(500) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be too low
we now have the capacity to suggest the relative importance of a given thread. A thread can be: - urgent, meaning it will run every frame for 15 seconds before relinquishing control - normal, meaning it will run every frame for 20 milliseconds - background, meaning it will run every frame for at most 2 milliseconds Login thread is the only thread expected to be urgent, as the experience of spillover from loading screen into contentful frames kind of sucks. background priority is currently unused, though migrating snapshots & spell cache to background priority threads seems appealing additionally, add capability for threads to indicate how much time the next action will probably take thread runner will use that time estimate to determine if it should defer the next action until the next frame default is 1000 ms for urgent threads, 1 ms for normal threads, and 0.5 ms for background threads
the times selected are completely arbitrary. The primary reason for this is to make WA liable to defer Resume() until the next frame, if AddMany() takes a decent chunk of time (usually due to migrations).
A user who's really determined can still defeat this strategy by importing so many auras that Resume() itself takes > 19 seconds to execute, but there's very little we can do about that anyways.
Closes #5172 (not by fixing it, but by making it less likely)