pendo-io / pendo-mobile-sdk

Pendo captures product usage data, gathers user feedback, and lets you communicate in-app to onboard, educate, and guide users to value
https://www.pendo.io
Other
57 stars 2 forks source link

SwiftUI serious hangs #140

Closed DwayneCoussement closed 2 months ago

DwayneCoussement commented 2 months ago

Platform + Version iOS 17

SDK Version 3.2.0

Framework Native, SwiftUI

Describe the bug Have a bit of a more complex SwiftUI view, notice that the Pendo SDK is slowing down the whole application (serious hangs if you attach it to the Time profiler)

To Reproduce Not sure what's the easiest way to reproduce, but having Pendo active and a bit of a more complex view (a gridview) that does some updates makes Pendo using a lot of time

Expected behavior The performance is the same with the Pendo SDK, as it is without it, no serious hangs.

Additional context Untitled

MikePendo commented 2 months ago

@DwayneCoussement Yes we are aware of it and fixing it now hopefully will release HF by end of the week

0xkuj commented 2 months ago

@DwayneCoussement HF version 3.2.1 was released. please install and reopen this ticket if needed!

0xkuj commented 2 months ago

in addition to that is will be highly recommended to change the integration with an addition flag as below:

let options = PendoOptions() options.configs = ["enableTextCollectionSwiftUI":false] PendoManager.shared().setup(prodAppKey,with: options)

this flag is meant to reduce the texts collection via reflection and base text collection on accessibility elements only.

this was done in our latest 3.2.1 HF fix, please try upgrading and let us know with your results.

DwayneCoussement commented 1 month ago

While it seriously improved a lot, it's still too slow, my UI still has hangs that are not there when I remove Pendo. I applied the options mentioned above; but I do hope that more improvements are coming. What I know see is that PDNHookFunctions is the cause, and not PDNScreenManager anymore.

MikePendo commented 1 month ago

@DwayneCoussement PDNHookFunctions its only a hook and doesnt (didnt) has any heavy processing. It forward the call to its flow after dispatching analytics in another thread. Can you please expand the trace of PDNHookFunctions and see who is responsible for the heavy weight?

MikePendo commented 1 month ago

In general our main concern (at least the one we noticed was during page change). and that what we attempt to resolve ( the PDNScreenManager). The Hook never caused a performance issue for us. BUT please share your findings and we will try to see what's going on

DwayneCoussement commented 1 month ago
Screenshot 2024-05-22 at 10 00 59

It seems to be hanging here; this is on a SwiftUI grid view with quite a lot of items. Each item has an image that will check from cache, and if it's not in the cache get it from the network and put it in the cache. Disabling Pendo = no UI hangs, Enabling Pendo = UI hangs. This also gets triggered during scrolling of the page.

MikePendo commented 1 month ago

@DwayneCoussement Can you please expand the call u shared? we need to see what is causing the hang. The image is only a stack of the calls. (the part u shared is just a swizzle of click Pendo shouldn't really do any heavy job on in that function, we need to see what is get called after that function)

MikePendo commented 1 month ago

or if your app is available on App Store we can check it on our own. (we might need creds if we dont have an option to login, and access to that specific ui content)