Massive lag spike when Android/iOS app returning from background

Hello everyone,

We’re developing an Android/iOS app and are running into a problem.

Whenever the app is put into the background for more than a few seconds, as soon as you call it back, a massive delay occurs; you can see the Profiler trace for it below.

This happens every time the app comes back from the background; how long it is seems to depend on how long the app has been in the background, so if you put your phone to sleep and come back a while later, it can take up to a minute!

Does anyone have any idea what might be causing this? Or maybe this is a bug? Has anyone run into something similar?

Input System is version 1.3.0, Unity is 2020.3.23f1.
If it’s relevant, we’re in Japan, so a lot of devices are natively set to Japanese; though I’m testing on a device set to English, and it doesn’t seem to make much difference.

Additional info:
We’ve found a bug where we were calling Physics.Simulate a million times whenever the app came back from the background, so that may have been the real issue.
I have no idea how that translated to the Profiler you see above though.