Hello everyone, after struggling a bit in my game, I open the game and occasionally I get 40 fps in the game. The only solution is when I exit Unity and enter a new version, the problem is solved, but after a bit of fiddling, I still get the same problems, I don’t know why.
Pictures;
if i reopen Unity
thanks
Performance in the editor isn’t really indicative of a problem.
Make a proper build, attach the profiler and see if the issue still manifests.
DO NOT OPTIMIZE CODE RANDOMLY… always start by using the profiler:
Window → Analysis → Profiler
It depends on the target architecture and runtime library of course, as all computer code runs on the actual CPU where your game is running, not some “theoretical magical global CPU of today” construct.
But in 2021 a floating point unit (FPU) is pretty standard on most targets.
All that said, don’t do needless work, especially on mobile, as that just burns down battery life.
If you suspect you have a performance bottleneck, DO NOT START MAKING OPTIMIZATION CHANGES!!
Instead, start with the …
Optimizing UnityEngine.UI setups:
Just so you know, the entire UnityEngine.UI system is available in source control from the package manager (and from github) and you can look at it and probably see there isn't going to be a lot of fat.
If there are some particular specific widgets you use in there that are too slow because of the use-generalization assumptions made, you might be able to get some benefit by tweaking them, but since so much of mobile performance bumps against pixel fill bounds, it's unlikely to g…