Performance
Performance analysis offers you a way to analyze your application's performance with an industry-leading level of precision:
- Measure wall-clock application startup time (starting from before the application process is created).
- Measure wall-clock execution time between any 2 arbitrary points in your application.
- Get a detailed execution trace to help identify bottlenecks.
- Automatically send warnings or block pull requests on regressions.
To measure application startup we need to know when the application can be considered "ready" and we can actually stop measuring. We will refer to it as end marker.
Typically an end marker is a point after all intermediate hops (such as splash screen) when the main screen is fully rendered.
To enable App Startup analysis, first add the following to the
config.yaml
at the root of Maestro workspace folder (the folder that you specify in maestro cloud
).maestro/config.yaml
1
appStartup:
2
enabled: true
Android
iOS
By default on Android, the App Startup analyses measures the duration between process start and first
Activity.onPostCreate
event. However, you can use other markers as well:log
Any log event. For example, you can send aLog.i(anyTag, "Application startup completed")
event from any place within the application.onPostCreate
Any activity name. Called during onPostCreate for an Activity that matches the regexonViewAttached
Regex of any view id. Called when the view id is attached
And then create your own Maestro flow that simply launches the app:
.maestro/launch.yaml
1
appId: your.app.id
2
mobiledev:
3
performance:
4
end: # Specify *one* of the following
5
log: Log event to wait for
6
onPostCreate: Regex of Activity name to wait for
7
onViewAttached: Regex of view id to wait for
8
on: reportFullyDrawn
9
---
10
- launchApp
To define an end marker implement UIApplicationDidBecomeActiveNotification or applicationDidBecomeActive(_ application: UIApplication) delegate method and add the following snippet:
NB! any log method that logs to Device System Logs can be used (i.e. NSLog or OSLog). Swift print() is not supported.
#if DEBUG
NSLog("finish span launch.appLaunchToMethodEnd")
#endif
Then, create a Maestro flow that simply launches the app:
.maestro/launch.yaml
1
appId: your.app.id
2
mobiledev:
3
performance:
4
end:
5
log: finish span launch.appLaunchToMethodEnd
6
---
7
- launchApp
Enterprise Only
Performance analysis for custom Flows is an Enterprise-only feature. Check out the pricing page for more details.
The process to measure a custom span (that is, duration between any 2 points in the app) is similar to measuring the app startup with some modifications. You would need to:
- Specify both start and end markers.
- Write a Maestro flow that navigates between two screens
.maestro/launch.yaml
1
appId: your.app.id
2
mobiledev:
3
performance:
4
start: # Same properties as in end marker. Using "log" as example
5
log: Start measuring
6
end:
7
log: Stop measuring
8
---
9
- launchApp
10
- tapOn: Some button
Once a performance analysis has completed, you will see a flame graph in the results. What it tells you is:
- What methods were called in what order (from left to right).
- What methods called what other methods (from top to bottom).
- How long each method took individually.

You can use this as a starting point for optimizing the performance of your application by looking at bottlenecks - methods that are taking the longest time to complete.
Occasionally, you will run into cases where a pull request introduces a performance regression. In such cases, a flame graph will show what methods have changed the most.

Last modified 3mo ago