NadyaNayme / NyusNecroJobGauge

An FFXIV-inspired job gauge for Necromancy
MIT License
24 stars 2 forks source link

Optimize FindBloat Method #5

Closed rodultra97 closed 2 months ago

rodultra97 commented 2 months ago

This pull request significantly optimizes the findBloat function by replacing the previous approach of using multiple setTimeout calls with a single setInterval for managing the bloat timer. This change results in more efficient resource usage, reduced execution overhead, and improved code clarity and maintainability.

Key Changes

  1. Replaced setTimeout loop with setInterval:

    • The previous implementation created 30 setTimeout instances for each bloat event to manage the timer countdown. This approach resulted in higher overhead due to the management of multiple timeouts. The new implementation uses a single setInterval instance per bloat event. This reduces the number of timer instances and minimizes resource consumption.
  2. Improved Timer Management:

    • The new implementation ensures that only one interval is maintained per bloat event. If a new bloat event is detected, any existing interval is cleared, and a new interval is started. This prevents multiple intervals from running simultaneously.
NadyaNayme commented 2 months ago

I do some incredibly stupid stuff in a lot of my apps so I appreciate PR's like this that fix some of the incredibly stupid things I did to make things work.

With that said if this is something you're interested in helping with I am planning a complete from the ground rewrite so if you're going to look into other parts of the code base I'd like to potentially save you some time and effort from digging too much into it.

rodultra97 commented 2 months ago

Hey Nadya,

I'd be thrilled to help out with the re-write if you'll have me! Just let me know what you need, and I'll get started!

Thanks, Omar

On Fri, Jun 21, 2024 at 7:48 PM Nadya @.***> wrote:

Merged #5 https://github.com/NadyaNayme/NyusNecroJobGauge/pull/5 into main.

— Reply to this email directly, view it on GitHub https://github.com/NadyaNayme/NyusNecroJobGauge/pull/5#event-13248449473, or unsubscribe https://github.com/notifications/unsubscribe-auth/BJKNGHH57ISAXF5QWQHB4NLZITQYLAVCNFSM6AAAAABJU3A6NSVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJTGI2DQNBUHE2DOMY . You are receiving this because you are subscribed to this thread.Message ID: @.*** com>

NadyaNayme commented 2 months ago

A bit unfortunate that I didn't do my due diligence prior to merging your PR - but I had to revert and undo your otherwise useful change as you're engaged with a part of RS that I would not like to be associated with even by proxy.

I'm going to have to rescind my offer to work together as well. Sorry for wasting your time

rodultra97 commented 2 months ago

I hope you might reconsider. I believe you're referring to JRPlugins. Jancarlos is my younger brother, and what he does in his spare time is not a reflection of myself. I'm a big fan of your work and would love the opportunity to collaborate with you. I never worked on that repo; I only forked it to view his work. I've removed the fork from my repository because I genuinely want to work with you.

Thank, Omar

On Fri, Jun 21, 2024 at 8:48 PM Nadya @.***> wrote:

A bit unfortunate that I didn't do my due diligence prior to merging your PR - but I had to revert and undo your otherwise useful change as you're engaged with a part of RS that I would not like to be associated with even by proxy.

I'm going to have to rescind my offer to work together as well. Sorry for wasting your time

— Reply to this email directly, view it on GitHub https://github.com/NadyaNayme/NyusNecroJobGauge/pull/5#issuecomment-2183761976, or unsubscribe https://github.com/notifications/unsubscribe-auth/BJKNGHFSAHEHBNQU64O4KA3ZITXYTAVCNFSM6AAAAABJU3A6NSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBTG43DCOJXGY . You are receiving this because you are subscribed to this thread.Message ID: @.***>