-
Notifications
You must be signed in to change notification settings - Fork 15
app is too slow to load #31
Comments
This is partly due to UIWebView being throttled by iOS. With the release of iOS 8 Apple is implementing WKWebView, which is much more favourable for hybrid apps (source). People are already reporting significant speed improvements, particularly in regards to javascript (anywhere from 20% to 300%). The bad news, as you may have guessed, is that this will be an iOS 8+ feature. I believe the Cordova team are working on a way to use WKWebView with a fallback to UIWebView for iOS 7, but it's not ready for primetime yet. |
Oh, so it won't work automatically after the update to iOS 8, you need to call different SDK code to get the speedup? That sucks. |
breadwallet is written in objective C and is 100% native for iPhone. I think the ability to use the same wallet on the web and your phone is a great feature though. (although in actuality... if you wanted to use the hive seed with breadwallet, then you'd get faster access to the same bitcoins... so I could see the dilemma.) |
I am aware of that, I'm just saying that from a user's perspective it won't matter, they will just compare two competing products, and if one of them starts in 3 seconds and the other in 16, they might be inclined to go with the first one. |
Absolutely right. We have to improve this. |
I agree. This issue needs to be solved. It's just not surprising, is what I am saying. Would it be possible to code the local crypto (login section) section only in objective c? or would it be difficult to alter the phonegapped code? |
@jsuder roughly what's the percentage of time spent on "verifying pin" vs "synchronizing wallet"? |
Almost all of it on "verifying pin", and "synchronizing wallet" is the last 1-2s. |
So that means it's CPU? What the hell is it doing for 8 seconds?... |
"verifying pin" consists of: one network call to fetch the long token, then AES decrypt the seed, calculate wallet id (sha256 the seed), and init wallet with the seed. A quick profiling suggests that wallet initialization took the longest Poor man's profiling:
Let's zoom into wallet initialization:
So yeah... computation. We could store the encrypted internal and external accounts and skip all the derivation, which will definitely speed things up. |
I have no idea how easy it is to fix it, or if it's the network that is the bottleneck or the CPU, but the fact is, that the app opening experience is far from perfect at the moment.
Compare:
Opening Breadwallet:
∑ = 2-3s until it's ready to use.
Opening Hive iOS:
∑ = 16s.
Now, I am currently using the absolutely fastest iPhone currently available on the market. There are people who use iPhone 5, iPhone 4S or iPhone 4, and for them it will take either a bit longer or much longer, depending on how much of that is network and how much is CPU.
I know that Breadwallet validates locally and Hive needs to connect to the server to get a PIN. But: 1) users won't know or won't care, 2) even with a network connection it should take maybe 3s. And the launch shouldn't really take 5s either...
The text was updated successfully, but these errors were encountered: