bither / bither-android

Bither - a simple and secure Bitcoin wallet!
http://bither.net
Apache License 2.0
436 stars 171 forks source link

Bither uses 10% of my battery #2

Closed dskloet closed 10 years ago

dskloet commented 10 years ago

Since I have installed Bither on my hot wallet phone, it has used 10% of my battery while I have used it only once. This is a lot.

bithernet commented 10 years ago

We are working hard on battery save now. We will tuning it in the future version. Thanks :)

bithernet commented 10 years ago

@dskloet , After we switched from bitcoinj to bitherj, the battery usage was much less than before (maybe 1/10).

dskloet commented 10 years ago

I just installed bither again and 1 or 2 hours later my phone was noticeably hot and bither had used 5% of my battery in that short time. On Sep 16, 2014 5:11 PM, "bithernet" notifications@github.com wrote:

Closed #2 https://github.com/bither/bither-android/issues/2.

— Reply to this email directly or view it on GitHub https://github.com/bither/bither-android/issues/2#event-166101310.

bithernet commented 10 years ago

Dear @dskloet ,

We are trying to improve the battery usage as possible as we can. In currently version, we can confirm that Bitherj is much more efficient thant Bitcoinj, and we will keep improving this in the future. Maybe we will provide advanced configurations for users in next version.

Thanks for your advice.

dskloet commented 10 years ago

But why is it using battery when I'm not even using the app? What is it doing in the background? I didn't even create an address so I can't think of anything it might want to be doing.

bithernet commented 10 years ago

@dskloet , Bither is a decentralized Bitcoin wallet, and it has to run a service to sync with the Bitcoin P2P network. Even when you have no address, Bither will still have to connect to peers and sync the block headers with the Bitcoin Blockchain. We use a tuned model for service running, also we plan to provide more options for user to configure the sync period. In next version, we will provide "only sync when you open the Bither" option. Thanks for your suggestion. :)

dskloet commented 10 years ago

Does it start by syncing from the genesis block? Is that why it uses so much in the beginning?

I had Andreas Schildbach's wallet (based on Bitcoinj) installed a while ago but I don't remember it using so much battery.

bithernet commented 10 years ago

@dskloet , Bitherj is also a SPV thin wallet implementation, and we will improve the battery usage in next version. For the comparation to Bitcoin-Wallet (based on Bitcoinj), with only 1 address and serveral transactions, Bither is far more efficient than that. Because each time when a new block arrives, bitcoinj will update the whole blockheader files and all transactions in wallet files.

In next version, we will keep improving Bitherj's battery usage.

Thanks :)

dskloet commented 10 years ago

It's great that you will improve it but you missed my question :). Right after install, does it start by sync everything since the genesis block? Is that why it uses a lot in the beginning?

bithernet commented 10 years ago

@dskloet , We used the SPV thin wallet mode, that means Bither will not sync since the genesis block (same as Bitcoinj). But Bither does not pack the SPV header file in the apk. So when you first start using Bither, it will sync block headers with the Bitcoin peers (maximum 2016 blocks).

Sorry for missing your question. :P

dskloet commented 10 years ago

OK, so I'll try installing it again when I charge my phone and see if it gets better after a while.

Maybe an idea to (have a setting to) only sync while charging?

bithernet commented 10 years ago

@dskloet ,

Here, our team want to say special thanks to you, because your questions have already helped usa lot in improving Bither in many ways. Thanks!

Sincerely,

Wen Hao Bither Team

dskloet commented 10 years ago

Thank you. Having an easy way to sign transactions offline is very important so thanks for doing all this work!

bithernet commented 10 years ago

@dskloet , In next version, we will provide options for users to configure the sync interval:

  1. 15 minutes
  2. 1 hour
  3. only sync when you openning the Bither

I think these may meet your requirements. Also, we tuned our sync logic (that will save battery usages too). You can try our next version for comparasion. :)

dskloet commented 10 years ago

Will those options help save battery? Or will it just once per hour use 4 times more battery than once per 15 minutes? Would it be difficult to sync only while charging the battery?

On Thu, Sep 18, 2014 at 11:45 AM, bithernet notifications@github.com wrote:

@dskloet https://github.com/dskloet , In next version, we will provide options for users to configure the sync interval:

  1. 15 minutes
  2. 1 hour
  3. only sync when you openning the Bither

I think these may meet your requirements. Also, we tuned our sync logic (that will save battery usages too). You can try our next version for comparasion. :)

— Reply to this email directly or view it on GitHub https://github.com/bither/bither-android/issues/2#issuecomment-56017168.

bithernet commented 10 years ago

@dskloet , If we provide an option for only sync while charging the battery, you will not receive new related transactions even when the Bither is openned. That will be a bad user experience. Definitely these options will save battery, cause peers management will also cause a lot battery usage. Thanks

dskloet commented 10 years ago

Sure, you should always sync when Bither is opened (even when you sync every 15 minutes), and probably also have a manual sync button. I just thought it makes sense to also sync when charging.

On Fri, Sep 19, 2014 at 2:53 AM, bithernet notifications@github.com wrote:

@dskloet https://github.com/dskloet , If we provide an option for only sync while charging the battery, you will not receive new related transactions even when the Bither is openned. That will be a bad user experience. Definitely these options will save battery, cause peers management will also cause a lot battery usage. Thanks

— Reply to this email directly or view it on GitHub https://github.com/bither/bither-android/issues/2#issuecomment-56123570.

bithernet commented 10 years ago

@dskloet , Thanks, we may consider your advices about manual sync and sync when charging. Thanks again. :D

dskloet commented 10 years ago

I've had Bither installed for several days now. I also have Bitcoin Wallet installed. I just made a full charge and after 1 hour Bither is responsible for 17% of the battery usage so far. Bitcoin Wallet doesn't even show up on the list (so < 1%?). What isBither doing that Bitcoin Wallet doesn't do?

songchenwen commented 10 years ago

@dskloet we will run a detailed test about this later to find where the problem lies and let you know when results comes out.

Thank you very much for your feedbacks.

songchenwen commented 10 years ago

@dskloet

Through my test, it comes out that bither actually used more battery than bitcoin wallet.

The reason for this is that bither's background service runs every 15mins/1hour up to user config.

But bitcoin wallet's background service's running schedule is not configurable but according to user action:

It's obviously bither uses less battery than bitcoin wallet during each background run, and bitcoin wallet's running less times makes its total battery usage much less. However less background runs can cause new transaction notifications be delayed.

In another word, if you leave bitcoin wallet closed for 2 days, and someone sends you 1BTC, your phone may play the coin dropping sound after 1 day. But with bither you may hear the sound within 15mins/1hour.

Quicker notice uses more battery, and bither is trying to save battery for every run and not reduce the count of runs.

Thanks for your feedbacks.

dskloet commented 10 years ago

But nobody can send me coins if I haven't even created and address.

I think it's fine the notification takes a long time if I don't use the app. Probably I used another app to receive it or I don't care that much. Otherwise I would have opened the app to check.

songchenwen commented 10 years ago

@dskloet

Thanks. We will keep working on this strategy and make it more reasonable.

bithernet commented 10 years ago

Dear @dskloet , Special thanks to you for questioning the battery usage. We had digged into this and improve a lot in Bither's new Android version v1.1.1 ! Thanks again, :)

Sincerely, Wen Hao Bither Team

dskloet commented 10 years ago

I've had Bither 1.1.1 installed for a few days now and regularly checked the battery usage screen and Bither has always been between 5% and 9%. While this is better than before, it's still not great. Is there anything I can do to help? Are there logs that I can send you or something?

bithernet commented 10 years ago

In my phone, Bither's battery usage is lower than 2% (I have many addresses and transactions). There may still be other improvements we can do. We will keep digging into this issue. We will try more situations to tune this. Also, we will proceed battery tests on more devices. Thanks to the helps you offering (especially for the logs). You have been very nice to our team. We will make more tests and try to do more tuning works to make our solutions better. :)

dskloet commented 10 years ago

I usually manage to squeeze close to 40 hours of life out of my battery. I don't know how much you use your phone but if you have to recharge every 12 hours, the same things that's 2% for you might be 7% for me. How much does the Schildbach wallet use on your phone?

My usage pattern is as follows: Install Bither. Open it once to choose the hot wallet. Don't add an address. Don't do anything else. Never use the app.

bithernet commented 10 years ago

Schildbach wallet use more battery than Bither on my phone. Could you tell us your phone's model? We will try to do the same things as you, and figure out how to improve this. Thanks, :)

dskloet commented 10 years ago

Very strange. For me Schildbach doesn't even show up on the battery usage screen. I have a Nexus 5 with Android 4.4.4.

bithernet commented 10 years ago

Thanks, we will try Nexus 5 soon. :)