Quote Originally Posted by ZorbaTHut View Post
THIS IS NOT REGARDING 1.8, THIS IS PROBABLY REGARDING 1.9 I usually don't give ~~sneak peeks~~ of future changes, but in this case I figure the sooner the better: We're adding a performance watchdog to the addon system that is capable of straight-up killing Lua code that it thinks is taking too long. The kill threshold is going to be rather high, but there will be a much lower warning threshold which is considered an "error" even though it won't forcibly stop execution. At the moment, this threshold is 100ms per Lua environment invocation. That means 100ms maximum for *all handlers of an event combined*. The intention here is to avoid situations where addons can deadlock your entire Rift game. The performance may suffer after the kill is sent, and obviously killing addon code at arbitrary points could cause fascinating internal consistency issues, but we at least want people to be able to recover in a better way than simply crashing the client. This way you can "/r hold on guys gotta reboot" or maybe finish tanking a boss if you have to. The effect will be identical to calling error() at some arbitrary point. Both performance warnings and performance errors will show up as normal system errors. Hitting the warning point isn't going to break your addon, but if you're writing something CPU-intensive (auction addons especially), you'll want to figure out a way to spread your CPU out over multiple frames. I recommend looking into coroutines! They are your friend. You already shouldn't be hitting the kill point - if you are, you should definitely fix that. We'll also be adding an Inspect.System.Watchdog() that gives you an estimate of how much time you have left before the warning. You probably shouldn't be relying on this to be exactly accurate, it's a rough guideline only. Also, this shouldn't be considered a goal to hit of how much CPU to burn. If you're anywhere near the warning threshold you're probably doing something wrong. This should be considered an emergency escape hatch to turn fatal bugs into slightly less fatal bugs. The actual behavior of this might change significantly, but the behavior of Inspect.System.Watchdog() shouldn't change significantly ("seconds remaining until you're really making a bad mistake"). AGAIN, THIS IS NOT 1.8, DO NOT START PANICKING IMMEDIATELY, YOU HAVE PLENTY OF TIME TO FIX THINGS
Jump to post...