WalletConnectSwiftV2
WalletConnectSwiftV2 copied to clipboard
WalletConnect 100% CPU usage and increased device temperature due to the checkPairingState being run each second
Describe the bug Hello WC team! We experience a huge CPU usage and highly increase device temperatures while using your SDK. We use WalletConnect Swift Web3Modal, but according to the logs the issue is in the main WC Swift V2 library. From what I've found you setup a timer in PairingStateProvider which updates each second and inside it Decodes the sessions from the storage.
SDK Version
- Client: Swift
- Version: 1.13.0
To Reproduce Steps to reproduce the behavior:
- Initialize WC SDK
- Open Xcode App profiler and check CPU usage
Expected behavior No high CPU usage.
- If it is essential to check session each second, at least cache them in-memory to avoid long running operations.
- Moreover, some of these operations are happening on the main thread, which also affects an app performance
Screenshots Attaching the place where the issues is located
Device (please complete the following information):
- Device: iphone 15 pro max
- OS: ios 17.4
- Browser - (native app)
thanks for reporting this, I will investigate.
Hello guys! Do you have any news/updates? Thanks!
Hey, yes, we expire pairings earlier now and there should not be as many objects in the storage anymore. Please upgrade to the latest version
Hey, yes, we expire pairings earlier now and there should not be as many objects in the storage anymore. Please upgrade to the latest version
Hey! Ok, thank you!
Hey, yes, we expire pairings earlier now and there should not be as many objects in the storage anymore. Please upgrade to the latest version
Hello @llbartekll ! Thanks it works for us and the new version fixed this issue.
thanks for confirming, closing the issue then