Performance issues with swappy enabled

Hi!

We’ve been using a.UseSwappyForFramePacing=0 in our DefaultEngine.ini for quite some time. Recently, however, we decided to allow players to enable/disable dynamic resolution in the game, which required us to turn Swappy on.After enabling Swappy, we started seeing a negative impact on performance. In some cases it’s minor, but on certain devices it becomes quite noticeable.

All of the tests below were performed using an automated scenario that executes exactly the same actions for a prolonged period of time. From these runs, we collect .utrace files as well as CSV profiler data. We will attach the traces as an archive.We currently have two clear examples of performance degradation:

1) Redmi Note 13 Pro (Adreno 710)

The 95th percentile frame time increases by 3.56 ms, going from 19.893 ms to 23.764 ms.

2) Redmi Note 13 Pro Plus (Mali-G610 MC4)

The 95th percentile frame time increases by approximately 1 ms.

What we consistently observe in the traces (for example, on device (1), clearly visible around the 4th “SniperMode” timing region) is that the average frame time remains roughly the same with and without Swappy.

However, when Swappy is enabled, we start seeing random frames with very long Present times. To track this, we use a custom CSV profiler stat and an Unreal Insights counter placed in FRHICommandBeginDrawingViewport / FRHICommandEndDrawingViewport.

Concretely:

  • Without Swappy (device 1), frame times are usually around ~19 ms, with max values of about ~20–20.5 ms.
  • With Swappy enabled, we still see many ~19 ms frames, but also spikes up to 24–25 ms, which are caused specifically by long Present calls.

We are attaching an archive with the traces for both devices.

Could you please advise:

  • whether this behavior is expected with Swappy,
  • if there are known ways to mitigate these long Present spikes,
  • or how we could further investigate / diagnose this issue?

Thanks in advance for your help!

Best regards,

Daniil!

[Attachment Removed]

Steps to Reproduce
For a mobile device (i.e. Redmi Note 13 pro with Adreno 710 or Redmi Mote 13 pro plus with Mali-G610 MC4) enable/disable a.UseSwappyForFramePacing=0 in DefaultEngine.ini and see performance difference.

[Attachment Removed]

Hi Daniil,

Can you confirm the Android version on the devices in question? Does updating FVulkanAndroidPlatform.RequiresWaitingForFrameCompletionEvent to return true alleviate the issue on these devices?

Best regards.

[Attachment Removed]

Hi Stéphane,

Both devices are Android 13.

Will check your proposal with RequiresWaitingForFrameCompletionEvent and give an update with the results, thanks!

Best regards.

[Attachment Removed]

Hi!

I have an update. I tried modifying RequiresWaitingForFrameCompletionEvent in VulkanAndroidPlatform to return true, but this actually made things worse:

1) Redmi Note 13 Pro (Adreno 710)

The 95th percentile frame time increased to 24.168 ms (+0.404 ms). This change is relatively small and might fall within the margin of error.

2) Redmi Note 13 Pro Plus (Mali-G610 MC4)

The 95th percentile frame time increased to 19.519 ms (+1.914 ms), which is a more noticeable degradation.

I’m also attaching the traces for reference.

Best regards,

Daniil

[Attachment Removed]

Hi Daniil,

From my understanding, that is a necessary thing but is limited to Android 15+ on certain device profiles. We expect future versions of UE to enable it as needed but it would indeed make things worse on devices/driver versions that don’t require it.

We’ll continue further investigation with the development team and reach out with an update once we have something to report.

Best regards.

[Attachment Removed]