[Bug] Big frame drops when opening inventory or wearing armor sets
RCalosena opened this issue ยท 48 comments
My game runs at about 130 fps normally.
- When I open my inventory, my frames drop to about 10-20 fps, only when I hover my mouse on items in HEI
- When I wear any armor set, my frames drop to about 72 fps
Could you try this version out (with tooltips turned on, like when you noticed the FPS drop), and tell me how it performs?
SetBonus-1.12.2.038a.jar.zip
- Roaming around, I get 100+ fps
- Hovering on items in HEI drops fps to 10
- Wearing armor drops fps to about 30, with stutters
It could be a mod incompatibility, I just tried multiple times to get my frames to drop on the instance with just this mod, and it seems to run smoothly. I'll follow up on this if I find something else
Disabling tooltips altogether gets rid of the JEI frame drops (I tried all JEI/HEI tooltip search modes and they all caused frame drops), I couldn't find a fix for armor sets, but my guess is that either too many armor sets or too many armors in a big modpack cause the armor set frame drops.
(Also, if you can send me your SB config, just so I can see how "big" it is)
I may have to do more detailed testing...
Make sure you're not on mode 2 (always update) for the JEI / HEI tooltip update option (mode 1 should be fine)
Couple questions:
- Does the armor wearing thing happen when SB tooltips are turned off all the way?
- Does this happen on version 1.12.2.035?
Actually, since you're used to posting modpacks, you know how to export a modpack. If it's in an export-able state and you send me the resulting archive, I can test it directly on my end and probably do a better job figuring things out (idk if that's currently an option or not)
V. 1.12.2.035 still has the issue. I'm exporting the modpack over here for you to test stuff then
Dang, sounds like a possibly painful one to fix Thanks for the export
Do you want it to have the most recent version of set bonus, or the version I was using before? (1.12.2.020)
I can swap the Set Bonus versions around for testing, not worried about that part
Everything else in most relevant version if possible though
It's failing to upload the zip here, so here's a drive link: https://drive.google.com/file/d/19J4jaMGLFKPcW9mQocvSulfg6I_yL2c9/view?usp=sharing
The issue seems to be twofold (which I kinda expected based on what you said).
-
There seems to be a pretty bad general performance drop when running Set Bonus 1.12.2.036 compared to 1.12.2.020, at least in this modpack (I would assume in any modpack large enough, unless there is a weird mod compat issue).
-
The newer Set Bonus tooltip render has poor performance in the modpack (again, probably any large enough modpack).
For the general performance issue, I'll just have to add some more detailed profiling calls internally and then run it in the pack and see if I can find out what's going on there. I know which event handle the issue is in, at least, so I'll start there.
The indev version I sent (1.12.2.036a) tried to solve the 2nd issue by caching the last itemstack displayed and the lines previously added to its tooltip, and reusing them (unless you hold shift, in which case it re-calcs them in real-time). This actually works...when it works. There is some kind of mod compat issue where it looks like it's "fighting" over the tooltip. It seems to fix itself if you...wait long enough? Randomly? At which point that part of the performance issue goes away. I'll have to figure out what the compat issue is there and try to fix it.
Yeah, that sounds extremely tricky. Well, good luck on that!
I think the mods that change tooltips in my modpack are: Dynamic Stealth (which has tooltips disabled anyway), Legendary tooltips, and I guess Crafttweaker too. Maybe that could give you a good starting point.
(This is half a note to myself so I don't lose track of things)
I've found and fixed the tooltip issue, but also found one additional issue:
Elenai Dodge 2 throws a concurrent modification exception when tooltips are accessed by more than 1 thread, which causes Set Bonus's JEI / HEI tooltip reload to fail (only has a chance of happening if you're looking at tooltips while a JEI / HEI tooltip reload thread is running)
The main general inefficiency seems to be from my library's item filters. Adding oredict and regex support made them a bit heavy. I'll see what I can do about that in the next day or 2.
Try these when you get a chance (Set Bonus and Fantastic Lib):
SetBonus.zip
On my end, profiling shows I've improved general CPU performance by ~50x and general heap performance by over 100x
No, those are not typos, and I didn't mean % either :P
The tooltip thing should be fixed as well
There are 2 remaining known issues with Set Bonus that are relevant to your pack, but since neither should have any major affect on main game performance, I'm putting them in as their own issues:
#37
#38
Tell me how those new files work out. They should make a big difference.
Good news is that wearing armor and hovering on items doesn't affect performance anymore, however, I'm trying to make set bonus tooltips show up but it seems like they don't appear at all.
I checked if every client config was fine, checked the item blacklist and also if the armor sets that I made for some reason had their tooltips set to discovery, or hidden. I also played with the JEI modes and nothing seems to make the tooltips render.
My first guess is that I missed a cache reset or something...try restarting the client once (with correct settings applied) and see what happens
Yeah, just restarted with all client features enabled, also removing the elytra from the blacklist to be extra safe, and opened a new world. The tooltips are still gone. The actual set effects are there though.
Huh...yeah, I just tested it too, and got the same result. I'll have to see what I did there
This should fix that issue, give it a try:
FantasticLib-1.12.2.065.jar.zip
Tooltips are back, performance is stable, though I think I am getting lower framerates than version 1.12.2.020
I waited a while and my average fps is about 90, then after testing version 1.12.2.020, I get an average of 110 fps after waiting much less for things to render and cache.
I tabbed back into the game and it's running better? I am observing less stability, though. When I load new chunks my fps drops to a minimum of 56 fps, while in older versions of SB, I never got framerates below 60, or even 70
For me, it is pretty stable already, but I fear that this performance impact will be much worse for people in lower end devices.
The long wait is likely due to the threaded JEI / HEI tooltip reload (I assume it's turned on atm). There are a lot of items in the modpack, they have somwhat large tooltips on average, and I think I counted 34 event listeners on one of the 2 tooltip events...so all of that slows the process down.
That runs on another thread though, so it won't tank performance, at least. This is issue #37 btw, assuming it's what I think.
Other than the startup thing, yes, the general performance is not quite as good as version 20 (though it's far better than it was in the recent past). I'll look into it a bit further and see if I find something else to improve on.
Sounds good to me. I think from now, it's better if you upload this new version. That way some friends I have with lower end computers can test it and see if their performance is severely impacted.
Yeah, I think any further improvements can wait for the next version. Currently I'm getting over 500FPS with my "staring at ground" test (after loading all nearby chunks).
I'm also seeing other mods use a lot more resources on the profiling than Set Bonus at this point. I might do some more performance tests on the pack and ping you on discord if I find something for sure.
update: disabling dynamic tooltip searching seems to bring back pretty much all performance that was lost, which I guess makes sense. Since my modpack was already adapting to the fact that you couldn't search for the armor bonuses' tooltips, by having a Crafttweaker tooltip with the name of the class that uses that armor set, in the worst of cases, I would just set dynamic tooltip searching to "never", since in my specific case, it doesn't hinder the experience in any way.
I was on the fence about that, but I guess I could probably just remove it entirely. The cases where it would really matter are...pretty rare.
I'm not going to do a public release just for that though, and I'm going to work on a few other things, so it will be a while before it sees public release.
In the meantime, feel free to distribute this version if you want, with it removed:
SetBonus-1.12.2.039a.jar.zip
I'm glad you brought it up though, because I just noticed that it's not updating when you re-hover the mouse
Well, specifically if you re-hover without looking at any other item's tooltip between
In any case, I'll have a fix for that soon
Well, idk why I didn't think of this approach before, but now it refreshes perfectly fine without altering performance, no re-hover or button pressing necessary. Still going to save public release until I have something bigger to add though, so here's another jar.
(Note that this is all just for tooltip render, not JEI / HEI tooltip searching, which is a whole different issue)



