Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabled ShowTime should not slow down the app #54

Open
MacMark opened this issue Jun 6, 2022 · 2 comments
Open

Disabled ShowTime should not slow down the app #54

MacMark opened this issue Jun 6, 2022 · 2 comments

Comments

@MacMark
Copy link

MacMark commented Jun 6, 2022

I use ShowTime in one app and i really like the visual user interactions. It is very helpful for demoing features and reporting bugs via screen recordings.

The app detects if it runs on an internal test device or not (by looking for an installed other non public app which enables test mode even on release builds) and uses for non-test devices
ShowTime.enabled = EnabledNever
and i expected it would then use close to zero CPU time in this case.

I run into performance issues with the app and analysed it with Instruments. I found ShowTime using more than 24% of all the app's CPU time even when disabled:

284.00 ms 24.2% @objc UIWindow.swizzled_sendEvent(_:) ShowTime
283.00 ms 24.1% UlWindow.swizzled sendEvent(:) ShowTime

image

Can i fix this by myself?

@alexfoxy
Copy link

In my testing I have found that it makes any difference to CPU usage.

@KaneCheshire
Copy link
Owner

Hey @MacMark, sorry for the mega delay (I worked somewhere that I wasn't able to work on OSS stuff so just taking a look through some issues now).

This is surprising to me because ShowTime checks if it's enabled before processing any touches, if it's not enabled it just bails out (check the implementation of swizzled_sendEvent.

Were you able to understand what part of swizzled_sendEvent is using CPU time? Might just be the swizzling of the objc runtime causing it. If that's the case then I might be able to improve it so that it only swizzles the objc stuff when enabled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants