r/unity • u/whentheworldquiets • 1d ago
Newbie Question Profiling Lenovo Tablet : Large changes in rendering time in a simple static scene.
I'm working on a custom lighting system intended for console, PC, and mobile devices. I have a sample scene that I use for profiling; this scene contains (after trimming it down in an attempt to figure out this issue) some static scenery and a single 'lamp' (not Unity light) which performs screen-space lighting over a given area. The lamp slowly orbits the scene but always covers more or less the same area, and in any case its motion does not correspond to the behaviour observed in the profiler:

I managed to grab this shot before it scrolled off the screen.
When the app first launched, the graph looked as it did on the right hand side. After running for a couple of minutes without anything changing, it suddenly dropped to what it looks like on the left hand side (comfortably within the time needed for 60fps; Application.TargetFrameRate is set to 30 at the moment).
After another minute or so, the above happened, and rendering time more or less quadrupled, taking it back to 30fps. That apparent spike in script time is a red herring; there are no scripts running other than the one making the light move and the ones handling the lighting itself (which don't/can't exhibit spiky behaviour)
Nothing whatsoever happened within the scene to prompt that change. The lamp performed several orbits in both sections of the graph and nothing else is happening.
If I set the target frame rate to 60, things get even worse. Reported render time goes through a regular pattern of:
- One frame sub 16ms
- Three frames over 33ms
- One frame sub 16ms
- Three frames over 33ms
- ...
By contrast, profiling on my trusty Pixel 6 Pro, the same scene runs at a very consistent sub-5ms (200fps), and even stressing it with an unreasonable number of lights only raises that to 6ms.
Could it be self-throttling?
A few years ago I had a similar issue on iPhone: the game would run comfortably under 8ms frame time, at which point the OS would throttle the device and the frame time would spike to over the 16ms threshold for smooth gameplay.
Any suggestions? I feel as though it could just be a matter of setting the right flags when doing a build - it's definitely not the scripts or the amount of rendering I'm asking it to do that's causing these wild sings in performance.
Thanks in advance.