Skip to main content

Overview

When integrating any SDK into an iOS application, understanding its performance impact is crucial for maintaining a good user experience. The Flashduty RUM SDK is designed with the goal of minimizing performance overhead and provides transparent measurement data to help you evaluate whether the SDK meets your application’s performance budget.
The SDK uses asynchronous processing mechanisms, with all data processing performed in background queues without blocking the main thread.

Performance Benchmark

To evaluate the actual performance impact of the SDK on your application, we conducted performance benchmarks under typical usage scenarios. The following SDK features were enabled during testing:
  • Basic RUM monitoring: View, action, and resource tracking
  • Distributed tracing
The SDK was initialized with default configuration and simulated common user operations (such as page views, scrolling lists, network requests, etc.).

Test Results

MetricWith SDKWithout SDKImpact
Peak CPU Usage~44%~40%+4%
Peak Memory Usage~72 MB~68 MB+4 MB
App Launch Time~0.9 ms~0.65 ms+0.25 ms
Package Size+1.4 MB-~1.4 MB
Network Usage~22 KB sent / ~2 KB received-Varies with event volume
The above data are reference values under typical scenarios; actual impact may vary depending on application complexity, device performance, and SDK configuration.

Performance Impact Details

The SDK’s CPU impact primarily comes from:
  • Event collection and processing
  • Data batching and compression
  • Network request reporting
The SDK uses asynchronous processing mechanisms, with all data processing performed in background queues without blocking the main thread, ensuring it does not affect the application’s UI responsiveness.
The SDK uses a fixed-size memory buffer to store pending event data, which does not grow indefinitely over time. Stale data is automatically cleaned up to ensure it does not consume excessive memory.
The SDK initialization process is optimized, with impact on application launch time controlled to sub-millisecond level.
It is recommended to initialize the SDK as early as possible in AppDelegate’s didFinishLaunchingWithOptions to capture the complete application startup process.
The SDK uses a modular design, allowing you to include only the necessary functional modules:
Dependency NameImport NameDescription
FlashcatCoreDatadogCoreCore functionality (required)
FlashcatRUMDatadogRUMRUM monitoring
FlashcatTraceDatadogTraceDistributed tracing
FlashcatWebViewTrackingDatadogWebViewTrackingWebView tracking
Including only the necessary modules can minimize the impact on package size.
The SDK employs the following strategies to optimize network usage:
  • Batch reporting: Events are cached locally first and sent in batches to reduce the number of network requests
  • Data compression: Reported data is compressed to reduce transmission traffic
  • Intelligent scheduling: Upload timing is intelligently scheduled based on network status and battery level

Performance Optimization Recommendations

If you have specific performance requirements, consider the following optimization measures:
1

Adjust Sampling Rate

Reduce the number of collected events by configuring the sampling rate:
RUM.enable(
    with: RUM.Configuration(
        applicationID: "<RUM_APPLICATION_ID>",
        sessionSampleRate: 80 // Sample 80% of sessions
    )
)
2

Enable Features on Demand

Only enable necessary tracking features:
RUM.enable(
    with: RUM.Configuration(
        applicationID: "<RUM_APPLICATION_ID>",
        uiKitViewsPredicate: nil, // Disable automatic view tracking
        uiKitActionsPredicate: nil // Disable automatic action tracking
    )
)
3

Disable Background Event Tracking

If you don’t need to track background events:
RUM.enable(
    with: RUM.Configuration(
        applicationID: "<RUM_APPLICATION_ID>",
        trackBackgroundEvents: false
    )
)

Offline Data Storage

When the device is offline, the SDK stores data locally with strict storage space limits:
  • Uses fixed-size disk cache
  • Expired data is automatically cleaned up
  • Cached data will not affect device storage space

Battery Consumption

The SDK is designed with battery consumption in mind:
  • Automatically reduces upload frequency when battery level falls below a certain threshold
  • Leverages system background task mechanisms for data reporting
  • Avoids frequent device wake-ups