Rosewood-Development / PlayerParticles

The PlayerParticles plugin made by Esophose
Other
173 stars 49 forks source link

Optimize style updates #84

Closed fadookie closed 1 year ago

fadookie commented 3 years ago

updateTimers currently gets called for all styles even if they aren't in use.

We shouldn't waste time computing updates for particles that aren't in use.

In addition, it would be nice if a callback was added to style API so styles can know if they are being enabled or disabled.

HexedHero commented 2 years ago

Do you have a report showing this?

Esophose commented 1 year ago

So few calculations actually get done in the updateTimers method that I think it would be more performance intensive to avoid computing styles that aren't currently being used. The majority of the methods only contain either a single line of code or nothing at all. I'm going to close this for now as I don't think it's necessary, but if you have any more input on the matter I'd be glad to hear it.