Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Skip to main content
Tracing measures code execution time to identify performance bottlenecks. When your app has slow responses or delays, tracing reveals where your code spends time during execution, especially in frequently called functions or intensive operations. Vega has built-in support for Perfetto, a tracing system for analyzing app performance. To track specific areas of your code, you can add trace points using Systrace, a React Native API that lets you emit traces from JavaScript. This page provides steps to:

Video overview

Watch this video for an overview of using Perfetto.

Add traces in your app

Using Systrace, consider adding trace point in the following areas of your code:
  • Functions that run frequently
  • Operations that take long to execute
  • Event handlers for user interactions
  • Areas where you suspect performance issues
Tracing focus performance When investigating slow focus behavior while scrolling a FlatList with TouchableOpacity components, add traces around the onFocus callback function. Example:

Record app traces

After adding the necessary traces in the app JS code, rebuild your app, run it on a Vega device, and record the traces.

Step 1: Rebuild your app

Rebuild your app to incorporate the performance traces into the app bundle. Make sure you use a Release build configuration for accurate trace measurement. For build instructions, see Build Your App.

Step 2: Install and run your app

Install and run the rebuilt version of your app to begin collecting trace data. Make sure to run your app on a Vega-supported device for accurate trace measurement. For instructions on running your app on a Vega device, see Run your app on Fire TV Stick.

Step 3: Record app traces

Record traces of the performance issue using:
  1. Launch the app.
  2. Run Activity Monitor.
  3. Start recording.
  4. Perform scrolling within the app.
  5. Stop recording. Screenshot that shows output files under the generated directory.
When recording is complete, Activity Monitor creates output files in your project’s generated directory. The name of the directory shows the recording timestamp. Activity Monitor generates the following trace files in your project directory:

Analyze app traces in Perfetto UI

After collecting traces, use Perfetto UI to analyze the duration and call patterns of your custom traces.
  1. Open your trace file in Perfetto UI. Screenshot that shows an open trace file in Perfetto.
  2. Click Open trace file.
  3. Select the iter*\vs\trace file from the generated directory.
  4. Drag the iter*\vs\trace file from the generated directory onto the Perfetto UI webpage.
  5. Wait for the trace to load.
  6. Enter the trace name in the top search bar to find your added traces. The following image shows a VegaVideoApp:FocusedElement:onFocus trace added in the onFocus handler. Screenshot that shows an added trace in the onFocus handler. If you have the Vega Studio extension installed, you can open trace files directly in VS Code:
    1. Go to your project’s generated directory in VS Code.
    2. Click the trace file you want to view. The file opens in the Perfetto UI within VS Code.
    For each trace:
    • Analyze the duration across all occurrences to verify expected behavior.
    • Check any stacked traces to confirm the expected call pattern.

Last modified on November 14, 2025