Performance Benchmark
Apr 1, 2025

We conducted a performance test on an Example app, comparing the Pledge framework and RxSwift, both tested on the same iPhone 14 under identical environmental conditions. The analysis reveals the following insights:
CPU Profiler
RxSwift: 7.79s (100% weight)
Pledge: 6.69s (100% weight)
This represents a 14% reduction in CPU processing time with the Pledge framework, indicating more efficient CPU utilization.
Based on the CPU profiler analysis of Pledge, the results reveal several key differences in performance between the two implementations. The Pledge framework shows more consistent CPU usage over time, with fewer spikes compared to the RxSwift version. While both frameworks show similar levels of CPU load for UIUpdateSequence operations, Pledge demonstrates slightly lower overall CPU consumption and a better-balanced distribution of the load.
Additionally, the Pledge framework's run loop components are more visible, offering clearer insights into event processing. A notable difference is the lower sample count in the Pledge profile, which might indicate less CPU-intensive operations. Pledge framework proves to be more efficient than RxSwift, with lower CPU consumption, better run loop integration, and more balanced component usage, making it a more optimized solution for certain application workloads.
Thread Activity
Both frameworks use mutex locking, but RxSwift’s more frequent mutex operations suggest more complex synchronization requirements, leading to higher CPU overhead.
RxSwift: 83,255 samples collected
Pledge: 71,681 samples collected
While both frameworks exhibit similar thread locking patterns, RxSwift demonstrates higher thread activity, which suggests greater thread contention or synchronization overhead.
Allocations
The memory usage comparison between the Pledge and RxSwift frameworks reveals that Pledge is more memory-efficient. Pledge consumes about 15% less total memory (291.74 MiB vs. 335.44 MiB) while maintaining similar persistent memory usage. Pledge also creates fewer objects overall (10.48 million vs. 12.42 million), with 19% fewer transient allocations, suggesting more efficient memory management. While both frameworks show similar allocation patterns for string immutables, RxSwift has higher allocation counts in categories like NSArray/VM items and Malloc allocations. The reduced transient allocations in Pledge imply less garbage collection pressure and more stable performance. Overall, Pledge’s streamlined memory usage results in a more efficient implementation with less overhead, which can lead to better performance, especially on memory-constrained devices.
Time Profiler
The Time profiler analysis shows that the Pledge framework outperforms RxSwift in CPU efficiency. Pledge uses 14% less CPU time (6.69s vs. 7.79s) and collects fewer thread samples (71,681 vs. 83,255), indicating lower thread activity. The Pledge framework also shows more efficient handling of the run loop, spending less time in UI update operations compared to RxSwift. Pledge has fewer mutex operations, reducing synchronization overhead, and shows lower CPU usage in UIKit-related tasks. Combined with the earlier memory analysis, Pledge demonstrates better overall performance, using 14% less CPU, 19% fewer objects, and 15% less memory.
Leaks
Effectively no leaks were found in both the patterns. But the no dispose bag management of Pledge makes it even more easier than RxSwift to handle leaks. This streamlined approach significantly reduces boilerplate code and simplifies the overall development experience.
Performance Hotspots
RxSwift:
More time spent on UIInputWindowController operations
Higher CPU usage in keyboard scene delegates
Multiple dispatch and thread mutex operations contributing to CPU load
Pledge:
More direct CFRunLoop integration
Less overhead in mutex operations
More efficient handling of UIKit interactions
Better thread synchronization
Final Insights
When combining the memory usage data from previous tests, Pledge outperforms RxSwift with:
14% less CPU time
19% fewer object allocations
15% less memory consumption
Overall, the Pledge framework provides a more efficient solution with better CPU usage, memory management, and thread synchronization.
Disclaimer:
The performance tests conducted in this report were executed on an iPhone 14 under specific environmental conditions, including hardware configurations, software versions, and network conditions at the time of testing. As such, the results presented above are based on this particular setup and may vary when using different devices, operating system versions, or varying external factors. The performance of both the Pledge and RxSwift frameworks can fluctuate depending on changes in the environment, app usage patterns, or other variables, and should be interpreted as representative for the test conditions rather than absolute benchmarks.