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 a script to measure CPU time during app link startup. #43

Merged
merged 1 commit into from
May 29, 2024

Conversation

mstange
Copy link
Contributor

@mstange mstange commented May 24, 2024

This script kills all browsers, then launches the browser with a VIEW intent for a URL, waits a fixed number of seconds, and then checks the elapsed CPU time across all processes matching the provided package name.

For example, here we can see that Firefox used 35 seconds of CPU time across its processes during the first 10 seconds of wall clock time when launching a fresh instance to go to cnn.com:

% python3 startup_cpu.py -p org.mozilla.fenix -u https://cnn.com -t 10
Successfully killed process org.mozilla.fenix
Successfully killed process org.mozilla.fenix:tab24
Successfully killed process org.mozilla.fenix:gpu
Successfully killed process org.mozilla.fenix:tab3
Successfully killed process org.mozilla.fenix:media
Successfully killed process org.mozilla.fenix:utility
no processes matching com.android.chrome found, not killing any
no processes matching org.chromium.chrome found, not killing any
Waiting for three seconds.
Launching app.
Starting: Intent { act=android.intent.action.VIEW dat=https://cnn.com/... cmp=org.mozilla.fenix/.IntentReceiverActivity }
Waiting for 10.000000 seconds.
Gathering stats.
Total CPU time: 35 seconds

Copy link
Contributor

@MarcLeclair MarcLeclair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 works for me locally as well.

@MarcLeclair MarcLeclair merged commit 4187327 into mozilla-mobile:main May 29, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants