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

Add Profiling to mobile web debug options #46812

Closed
puneetlath opened this issue Aug 5, 2024 · 15 comments
Closed

Add Profiling to mobile web debug options #46812

puneetlath opened this issue Aug 5, 2024 · 15 comments
Assignees
Labels
Engineering NewFeature Something to build that is a new item. Weekly KSv2

Comments

@puneetlath
Copy link
Contributor

Problem

On our mobile apps, we have the Use profiling option for performance profiling. We don't have this on web because profiling can be done via the JS console. However, mobile web doesn't have a JS console, so it'd be useful to be able to have some way to do profiling there. Recently, we've had an employee experiencing performance issues specifically on mobile web.

Solution

Add the Use profiling option to mobile web.

cc @Szymon20000

IMG_53B5C847EEAD-1

@Szymon20000
Copy link
Contributor

👋🏻

@puneetlath puneetlath added the NewFeature Something to build that is a new item. label Aug 5, 2024
Copy link

melvin-bot bot commented Aug 5, 2024

Current assignee @puneetlath is eligible for the NewFeature assigner, not assigning anyone new.

@kirillzyusko
Copy link
Contributor

kirillzyusko commented Aug 5, 2024

Hey 👋
I think I added this option on web in #46133? It could be activated via Cmd+K combination, though yeah, I'm not sure how to show that menu on mobile web 😅

@hannojg
Copy link
Contributor

hannojg commented Aug 6, 2024

On mobile we have the 4-finger tap gesture to open that menu (implemented using RNGH), would the same work for mWeb @kirillzyusko ?

@kirillzyusko
Copy link
Contributor

Thanks @hannojg ! ❤️

I just tested and this indeed works:

telegram-cloud-photo-size-2-5300879088497584250-y

File sample:

Profile_trace_for_9.0.17-0.cpuprofile

But keep in mind that not all browsers support "sampling profiling", so not all browsers will produce an actual stacktrace (I tested in Safari and it didn't work, the downloaded file was empty). To see which browsers support that you can check this link 👀

The file above was captured in Android Google Chrome broswer.

@kirillzyusko
Copy link
Contributor

@puneetlath @muttmuure since it was deployed to staging - can we verify that it actually works there and close the issue?

@melvin-bot melvin-bot bot removed the Overdue label Aug 30, 2024
@puneetlath
Copy link
Contributor Author

I do see the option. This was on iOS Safari. Do we need to do anything else to verify it?

IMG_3AE841CD32DE-1

@kirillzyusko
Copy link
Contributor

You can toggle this button do some interactions in the app and stop profiling to be sure that performance profile is actually generated.

But you'll need to use Google Chrome, since Safari doesn't support this feature.

@puneetlath
Copy link
Contributor Author

puneetlath commented Sep 4, 2024

I tried it on iOS Chrome, but the profile was empty. It just had:

{"traceEvents":[],"samples":[],"stackFrames":[]}%

Does it work for you @kirillzyusko?

@kirillzyusko
Copy link
Contributor

kirillzyusko commented Sep 9, 2024

@puneetlath I've observed, that sometimes profile can not be generated and we just generate an empty stack trace (it happens randomly). But if I try second time, then everything works well 🤷‍♂️ I haven't figured out why it happens exactly, but may I ask you to try several times? Typically if the first time it was generated empty, then the second time you should get a real report 😅

@puneetlath
Copy link
Contributor Author

I tried many times in iOS Chrome on both staging and production and it was empty every time. Very weird! Any ideas?

@kirillzyusko
Copy link
Contributor

@puneetlath you are right, I've just tested Google Chrome iOS and I also can not generate a proper report. I think on iOS a self profiling is simply not supported (irrespective to the browser that you use) 😔

It's kind of weird, because on desktop we have a difference between Chrome/Safari, but on mobile it looks like both browsers behave in the same way 🤔

@puneetlath
Copy link
Contributor Author

Ah ok got it. But it works on Android?

@kirillzyusko
Copy link
Contributor

@puneetlath yes, Android should work fine :)

@puneetlath
Copy link
Contributor Author

Ok cool. Closing out then!

@github-project-automation github-project-automation bot moved this from MEDIUM to Done in [#whatsnext] #quality Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Engineering NewFeature Something to build that is a new item. Weekly KSv2
Projects
Status: Done
Development

No branches or pull requests

4 participants