DeviceActivityReport lag and performance issues

I've been experiencing some serious performance issues with DeviceActivityReport. Their severity tends to vary across devices - for some of my users it's really bad and for some it's mostly fine - but every device seems to experience these issues at some point.

1. DeviceActivityReport is completely blank. Often on launch, the DeviceActivityReport is completely blank and the only way to make it show up is to click back and forth between tabs, or quit the app and re-open it. Sometimes, it will show up after one or two seconds, but that is still a bad user experience. When looking at logs during this issue, I can see that makeConfiguration still runs successfully and returns a value, so I suspect the issue is with the rendering of the View in the App Extension.

2. Gestures are slow to register, or can't register at all. For example, if I place my DeviceActivityReport inside a ScrollView, I cannot scroll if I perform the gesture on the report view. If I try to scroll on the part of the screen that's not inside the report view, the screen scrolls but it will lag. This makes me think that if I perform a gesture on the report view, only the view inside the App Extension will register the gesture, but not the parent view in my host app. Is that the expected behavior?

My primary concern is number (1), it's by far the biggest pain point for my users and makes my app almost useless to them if they can't view their screen time :(. These issue have been reported before by other developers on the forum (https://developer.apple.com/forums/thread/723444, https://developer.apple.com/forums/thread/723491, https://developer.apple.com/forums/thread/720549).

Instead of recommending that I submit a bug to Feedback Assistant (which I will do), I am kindly asking for some recommendations to work around the known performance issues of DeviceActivityReport. Several apps out there that use the DeviceActivity API that do not appear to have these performance issues, like Opal and Jomo, so they must be doing something right!

One thing I've noticed is that the further up in the View hierarchy the DeviceActivityReport is, the better its performance, but I'm not sure why - maybe it is because the earlier the extension is connected to, the better. My app also has several tabs, makes network requests with asynchronous tasks on launch, uses the DeviceActivityMonitorExtension, and uses CoreData as a local data store. Maybe these things affect performance?

Thank you in advance for any performance recommendations that you could provide!

  • Did you find any solutions to the performance issues? I am facing similar issues.

Add a Comment

Replies

  1. It sounds like your extension is exceeding its memory limit of 100MB and subsequently getting terminated by the system. I'd recommend trying to reduce your extension's memory usage.
  2. We are aware of the gesture limitations of DeviceActivityReports, as they are views rendered by a different process than the parent app. However we'd still really appreciate an enhancement request using Feedback Assistant because it helps our team determine which enhancements and bug fixes to prioritize. Thanks in advance!
  • Thanks for your response Kmart! While profiling the extension in Xcode, it maxes out at around 10MB on my device. I've also ensured that I'm looking at the extension target and not the host app. Could the memory usage vary that widely on other users devices that it could exceed 100MB while my device maxes out at 10? Or might there be something else going on?

Add a Comment