With the above in mind, I have a suggestion for changing the Watchdog performance warning text.
Much better!Code:Error: Performance Warning. Rift is running slowly and may effect Addon performance.![]()
Thread: Watchdog puzzles With the above in mind, I have a suggestion for changing the Watchdog performance warning text.
Much better!Code:Error: Performance Warning. Rift is running slowly and may effect Addon performance.![]()
Rank 72 Guardian Mage
RotP 4/4 - DH 4/4 - GP 4/4 - GSB 5/5 - RoS 5/5 - HK 11/11 - ID 8/8
This does start to fit with the daily error reports I have, most of them are all showing a performance warning from the code I run based on the "PlayerReady" event from SafesRaidManager (you might have heard of it ;)
The code in question is related to cleaning up any stray unitframes I created based on the player's saved vars, from their last logoff/DC (it's related to in-combat reconnects where the frames need to be back up at player reconnect)
In the normal case I'd expect the tidy-up code to have little to do. (Of course the stack trace doesn't tell me how many units it is cleaning up, could be 1-19, only way to tell would be have a func for each size, so the name is in the stack trace) I have actually improved that code since getting the messages, as it was sub-optimal, and haven't had any error reports from the latest version hitting that issue (but that assumes people have updated).
However, that event is also the time that the action bars are loading and populating and a bunch of other stuff is streaming in. I wonder when the lua is jit'd, could it be the first time hit for the jit?
I guess what we really need is something that helps profile the lua, the stack trace is a starting point, but we want more info(I guess I'm spoilt by having profiling tools for my normal day job)
Note this hasn't stopped me working on how to improve my code's impact on the client, I'm working on solution for one of the areas.
Of course that doesn't really help you, as you've got some code that's <1ms to run most of the time, but you're getting blamed![]()
Oh yeah, don't get me wrong. I'm actually enjoying this challenge. I'm just feisty sometimes and tact isn't my strongest trait.
I'm tempted to somehow push the "Player.Ready" event further down the list and try and account for the client actually loading. Obviously, an event from the Addon API saying so would be even better (unless there is one and I've missed it).
Lets face it, SRM's Player.Ready should be more "Sync Start" so everything using it can all synchronize perfectly every start-up.
For KBM, I'm adding a new pre-fetch caching system for certain UI objects I normally create on the fly then cache after use. Instead, I can calculate the maximum number of these objects that could ever be used and use an auxiliary Event (I'm thinking System.Update.End) to load one object at a time per frame until the maximum has been reached and have a full cache. This will allow KBM to run at full speed and never technically need to create objects during combat (baring initialization during an encounter/combat).
So far, I've refrained from the obvious route which is to ensure my Addons insert their events at the beginning of the table and monitor their position. This would just be an *** like move I couldn't bring myself to do even though I know it'd probably remove practically all performance warnings for KBM.
PS. If I catch any other addon author doing the above, that'll be out-right war, just saying![]()
Rank 72 Guardian Mage
RotP 4/4 - DH 4/4 - GP 4/4 - GSB 5/5 - RoS 5/5 - HK 11/11 - ID 8/8
LOLError: Performance Warning. Rift is running slowly and may effect Addon performance.
Not sure if you know, but the watchdog is disabled during handling of Event.Addon.Startup.End.
In Gadgets, I was previously running a lot of my initialisation when the player became available, but I've now moved as much as I possibly can into the above event instead.
I believe the change to give each event handler (rather than the entire event) it's own 0.1s timeslice is fairly imminent, so hopefully an all out addon war can be avoided!So far, I've refrained from the obvious route which is to ensure my Addons insert their events at the beginning of the table and monitor their position.
Last edited by DoomSprout; 07-05-2012 at 08:06 PM.
HA! This I did not know. I'll use that as a synchronized start instead. Thanks!
Although, for anyone using SRM, this will not change what Player.Ready does, it'll just give another event fired through SRM to latch on to for any initialization.
Although if it did come to addon wars, scores must be registered! (j/k)
Last edited by Semele; 07-05-2012 at 08:16 PM.
Rank 72 Guardian Mage
RotP 4/4 - DH 4/4 - GP 4/4 - GSB 5/5 - RoS 5/5 - HK 11/11 - ID 8/8
Trying to keep the peace and moving back on-topic
Yesterday Zorba mentioned that the Watchdog is disabled "during load and shutdown sequences". Apparently this does not help your startup slowness?
It may indeed be the JITer being at the root of the initial slowness. LuaJIT does a combination of interpretation and compilation. It's possible that the first run of the function is fully interpreted and that the JITer decides to compile it for consecutive executions (kinda like the HotSpot Java VM)
Last edited by Thorarin; 07-07-2012 at 02:25 AM.
#39 Live changelog:
NONBREAKING CHANGES:
* The Addon Watchdog now counts execution time per event handler instead of per event. This means addons will no longer be influenced by the behavior of previous addons.
* The result of Inspect.System.Watchdog() is now more reliable.
Rank 72 Guardian Mage
RotP 4/4 - DH 4/4 - GP 4/4 - GSB 5/5 - RoS 5/5 - HK 11/11 - ID 8/8
I'm rewriting one of my addons so that all the UI creation/update happens in a coroutine.
Now, under normal circumstances, it builds fine and quickly and no warning are thrown.
Things change when a conquest match starts...
The build UI code is doing pretty frequent
But still warnings get thrown.Code:if Inspect.System.Watchdog() < 0.05 then coroutine.yield() end
It's not just addons that are running slowly though - stood in Sanctum, if I disable all addons, and do a /reloadui, I can actually watch the UI draw - the hotkey bars appear with visible delays in them.
Given the native UI is being affected by conquest running, what hope do addons have! (http://www.exyles.com/RIFT/2012-07-09_140510.avi shows this)
Putting something like
Before every line of code that does something UI related seems a bit of overkill.Code:local needpause = true while needpause do if Inspect.System.Watchdog() < 0.05 then coroutine.yield() else needpause = false end end
Last edited by Adelea; 07-09-2012 at 08:10 AM.
I'll quote myself here from the Bug Reports section of this forum. This'll be part of the reason your warnings are getting through.
The other unfortunate fact is, that if the Rift Client itself bogs down (regardless of Addons) you'll have next to zero performance left for your Addon as Addons sit on what seems to be a low priority thread and therefor a badly performing Client will start throwing errors for the smallest of handlers.
These are the hard facts unfortunately. Hopefully we can eventually get some lee-way on our thread priority or something, I dunno.
Just seems sad to me that KBM runs smooth as houses while I'm getting horrid ability lag. I check and check my diagnostics, and even panicked it was KBM causing the Client's button lag. But I don't believe it is. So, I can only imagine the blame KBM receives on lower end machines, when in fact it's the Client at fault, not the Addon.
Rank 72 Guardian Mage
RotP 4/4 - DH 4/4 - GP 4/4 - GSB 5/5 - RoS 5/5 - HK 11/11 - ID 8/8
I'm getting notifications for people getting the brutal 3.0 second chop, when opening dialogs that open instantly on my very low spec machine (1.8 Ghz Core 2 Duo, surely not many people are below that spec?).
It's depressing to get warnings on things that are totally outside your control.
Not sure what I can do about it, 3.0s is a *huge* amount of time, it's a tiny dialog, and I'm not even sure it's correct - one of the people who got it was Solsis, who told me in IRC that the dialog didn't seem slow to open.
From testing I've done, I still think the watchdog is targeting the wrong things entirely. I can knock loads off the framerate by simply adding Frames to the screen. I halved my FPS without so much as a whimper from the doggy:
Rift Addon API Benchmarks
I suspect this is generally having a much bigger impact on client performance than any actual processing we're doing in addons.
Last edited by DoomSprout; 07-10-2012 at 06:05 AM.
Bookmarks