OmniCC

OmniCC

54M Downloads

"Script ran for too long"

Jaliborc opened this issue · 8 comments

commented

@tullamods/omnicc-lieutenants:

Many users have been complaining of an intermittent error message, entitled "Script ran for too long".

After researching on the matter, it is clear that this issue has been introduced by Blizzards new "Limited lua execution time" feature. Yet, I am still not convinced that this was Blizzard´s intended resulting effect. I also guess this issue only occurs to users running the addon using the "classic engine", instead of the "animation engine".

Now, the question is: should we fix it? Is it even possible to fix? Splitting the engine into several update scripts instead of one could reduce the frequency, but I doubt this could be ever removed.

Useful links:

The AceTimer team decided to take no action on the issue for now.

commented

Ok, I would say this has been "fixed" - at least, as far as possible. With the effects being loaded before combat, there is almost no one complaining of the issue now.

Great!

commented

I've actually not heard of the issue from people using tullaCC, and after reading comments, I think its mainly related to the finish effects (pulse & shine). In addition, I don't think its a super widespread issue since we're not getting five billion comments at once about it :)

My initial suspicion would be that we either have stuck animations, or that having a ton of timers going off at once may cause the issue. The latter should be easy to test by setting the min duration for finish effects to zero and seeing what happens in combat.

commented

I was still not able to reproduce the issue, but I did not try to writing code for making it fail. :)

Yet, I am more convinced that the problem is having tons of timers going off at the same time. Although it is true the reports have always been regarding the shine and pulse, those are the most used ones, and I think if we had stuck animations the problem would be much more widespread.

commented

Ok, I think I've figured out what is screwing our performance: creating the finish effect frames for each button.
Currently, they are created "on demand" when the effect run for the button.

This means that if:

  1. A user logs in
  2. Does not fire many cooldowns
  3. Gets silenced or similar in a big fight
  4. Can experience a performance drop when all the cooldowns fire for the first time

I experience sometimes drops from 120fps to 30. That's a lot, specially considering that most players have less than 60fps on average. In a big fight, they will have even less.

Now, I think I also have a good solution:
Thanks to the change in the cooldown APi to the C layer a few patches ago, we now have a record of most cooldowns before frames before they are fired. Using that, we can initialize the effect frames on startup, instead of during combat.

This should solve more than 90% of occurrences, as it is the most performance intensive operation we execute.

commented

Sounds like a plan :)

commented

You will only hit this error in combat, so all testing should be done in combat.

Typical situations where this comes up is for example trying to bring up options in combat (for other addons)

commented

All my testing was made in combat 😄

commented

An update:
I made an enormous refactoring to OmniCC, splitting up the code in "OmniCC.lua" and "timer.lua" into small files. So now it's more ore alike the other addons (Bagnon, Combuctor, Ludwig,…).
It has already been released as a beta version, and I am now working on fixing issues that may have been created (refactoring always dangerous with no unit tests :D).

It also includes the "setup effects before combat" fix. Let's see if it works.