Performance Impact

See the platform-specific sections below for details on the performance impact of the Measure SDK on your app.

Android#

Benchmarks#

We benchmark the SDK's performance impact using a Pixel 4a running Android 13 (API 33). Each test runs 35 times using macro-benchmark. For detailed methodology, see android/benchmarks.

[!IMPORTANT] Benchmark results are specific to the device and the app. It is recommended to run the benchmarks for your app to get results specific to your app. These numbers are published to provide a reference point and are used internally to detect any performance regressions.

Benchmarks results for v0.16.0:

  • Adds 17.5ms-31.3ms (24.3ms median) to the app startup time (Time to Initial Display) for a simple app.
  • Adds 0.6-1ms to detect and create a layout snapshot for click gestures.

Profiling#

To measure the SDK's impact on your app, we've added traces to key areas of the code. These traces help you track performance using Macro Benchmark or by using Perfetto directly.

Here's the table:

MetricDescription
msr-initTime spent on the main thread while initializing
msr-startTime spent on the main thread when Measure.start is called
msr-stopTime spent on the main thread when Measure.stop is called
msr-trackEventTime spent in storing an event to local storage. Almost all of this time is spent off the main thread
msr-trackGestureTime spent on the main thread to track a gesture
msr-generateSvgAttachmentTime spent on background thread to generate an SVG layout
msr-captureScreenshotTime spent on main thread to capture and compress a screenshot
msr-loadImageFromFileTime spent on main thread to load an image from a file
msr-loadImageFromUriTime spent on main thread to load an image from a Uri

Comparison to Firebase initialization#

The following are the results from running a macro-benchmark test to compare initialization time of Measure SDK vs Firebase. Tested with firebase BOM version 33.7.0 and Measure Android SDK version 0.10.0 running on a Pixel 4a.

Firebase initializes in multiple phases. The total median time to initialize when running the benchmark for an app with Firebase crashlytics, performance and analytics SDK was observed as 77.6ms. While Measure took 35.0ms in the same macro-benchmark test.

Firebase Comparison

Perfetto screenshot from one of the runs:

Screenshot

iOS#

Benchmarks#

We benchmarked the iOS SDKs performance impact using a baseline app on an iPhone 14 Plus running iOS 18.5. Each scenario was executed 5 times and instrumented with os_signpost for precise time tracking. Metrics were collected via Instruments (Time Profiler and Logging with Signposts).

[!IMPORTANT] Performance impact varies based on device and application complexity. We recommend measuring impact in your specific app. The following numbers serve as a reference baseline and are used internally to monitor regressions.

Benchmark Results (v0.6.0)#

Measure adds 21.03–25.7 ms (avg ~22.8 ms) to app startup time (Time to Initial Display). Other key operations performed by the SDK can be found below:

Operationp95Description
trackEvent195 µsIncludes event collection, attribute enrichment, and queueing
appendAttributes360 µsDynamic attribute gathering (e.g., network, device state)
trackBugReport120 µsComplete flow including screenshot, layout, and metadata
trackEventUserTriggered32 µsUser-triggered event tracking
trackSpanTriggered96 µsWhen a trace event is emitted
spanProcessorOnStart105 µsSpan construction
spanProcessorOnEnded355 µsSpan serialization and buffering
generateScreenshot80 msSnapshotting and compression of UI
generateLayoutSnapshot7.5 msLayout hierarchy capture