Matsyir / pvp-performance-tracker

External plugin for RuneLite: Tracks PvP performance by keeping track of various stats during combat
BSD 2-Clause "Simplified" License
4 stars 15 forks source link

Lagging #18

Closed pwatts6060 closed 3 years ago

pwatts6060 commented 3 years ago

Describe the bug I was using this plugin in lms for a few minutes and I started getting big delays in my actions in a fight. Prayer switching 3-5 second delay. It seemed to be getting steadily worse and then i disabled the plugin and it was normal again.

To reproduce Not sure it only happened once. It was not the first fight though.

Expected behavior Really should not be lag for any reason.

Additional context I have used this plugin before. My fight history limit is 1000 and i saw the troubleshooting note about reducing the limit but this isn’t a real fix.

Matsyir commented 3 years ago

This is most likely something hardware or OSRS-server related that's out of my control. The plugin has been used by thousands of users by now, including during tournaments, and this issue was never brought up to me before. I am open to more details, that's a terrible experience and I'd love to fix it for you if I can, but I don't know of anything I can viably do right now. If you have a low amount of free RAM (regardless of your total), that's probably the killer.

Thing is, when the plugin loads, it basically loads your whole fight history into RAM, including the UI components representing them, to have them ready to be displayed when you open the panel. I have personally tested with 10,000 fights, and there were no issues for actual gameplay, but there was fairly high RAM usage (~1.5GB total for RL when 10,000 fights were loaded), and there would be lag spikes when a fight ends - but not during gameplay. My guess is that you're on 90%+ total RAM usage, and your system just can't keep up with the amount of page swaps your ram is doing. Although, the fight history limit doesn't matter if you haven't actually reached it - if you have 5-10 fights with a limit of 1000, reducing the limit won't change anything.

The only thing I can think of is to change the rendering logic of the panel, to only really have ~10-20 fights loaded at a time, and delete/update those same UI components as you're scrolling through your history. However, this is kind of out of the scope of the plugin - I tried to implement it that way initially, but Java doesn't have a native UI component to enable this "recycling" behavior, and it's a lot to implement for what it's worth in this plugin. I still believe the most viable solution for now is to simply reduce the fight history limit. If you want to save your existing fight history (so you can look back on your fights later, even if you set your limit to 5-10), you can export it by right clicking the total stats panel, and paste/save that to a file somewhere. Then you could freely play with your low limit, and when you want to look at your older fights, increase the limit and re-import the fights you previously exported to a file.

I've asked a tourny host (who is in contact with lots of users of the plugin) what he thinks, and he roughly says the same thing. Hasn't seen the issue, but it's expected to lag if you have a high limit on a low end PC, similarly to other plugins that load persistent data, such as the loot tracker (if you let it grow long enough). He's also informed me that OSRS servers have been pretty bad lately, and many users are experiencing similar delays in intervals of ~45min-1h, regardless of what plugins they're using or what they're doing in game. I haven't been playing myself, so I can't personally confirm that.

pwatts6060 commented 3 years ago

It might be a one off thing, I will try it again later. I was running through intellij if that gives any difference. Actually not sure if i was or not. Can close this for now. I’ll reopen if i have the same experience