web3swift icon indicating copy to clipboard operation
web3swift copied to clipboard

Creating a new wallet is too slow

Open xhzth70911 opened this issue 2 years ago • 6 comments

macos Version :12.3 xcode Version : 13.3
cocospod Version:1.11.3 Installing BigInt (5.2.0) Installing CryptoSwift (1.4.3) Installing PromiseKit (6.15.3) Installing Starscream (4.0.4) Installing secp256k1.c (0.1.2) Installing web3swift (2.6.0) 6870A674-EB41-4487-A38F-EA2E61FDFA79

Creating a new wallet is too slow, 5 seconds to print information E2E3812F-C162-468C-B004-0D1AD1F0F015

4F6F0A41-79A1-4E9B-9D12-E16F25DB473E

Get private key is too slow,5 seconds to print information The speed of creating wallet in web3swift version 2.3.0 is normal

xhzth70911 avatar Apr 19 '22 08:04 xhzth70911

This has been on my radar for a while. Now that EIP-1559 support is out I'll start looking into it now.

mloit avatar Apr 19 '22 15:04 mloit

What hardware are you building/testing on? Also can you try building in release mode to see if this solves the problem?

mloit avatar Apr 19 '22 16:04 mloit

你正在制造/测试什么硬件?

iphone6 plus

xhzth70911 avatar Apr 20 '22 01:04 xhzth70911

Can you please build your code in "release" mode, and report back if the issue is still present then?

mloit avatar Apr 20 '22 16:04 mloit

Please let me know if this exist in Real device as well

RaviRanjan-11 avatar Apr 28 '22 20:04 RaviRanjan-11

I can confirm that the issue lies between debug and release builds. I created a simple test app to create a private key.

Debug Build/Run: 7.790989995002747 Release Build/Run: 0.10214793682098389

The issue is also exclusively when building via SPM, as SPM builds everything from source, using the app's build settings. XCode projects include the libraries as frameworks, which are built separately in release mode, so even a debug app, does not see the same performance hit.

This not really an issue as it affects debugging only, and there is nothing we can really do about it. This is a known issue with CryptoSwift, you can follow the link posted in #535 if you want to know more.

This issue should probably be closed at this point.

mloit avatar Apr 28 '22 21:04 mloit