charging, battery, performance, caches and battery calibration myths busted

  1. Sridhar Ananthanarayanan Lollipop Feb 8, 2019

    Sridhar Ananthanarayanan, Feb 8, 2019 :
    I had mentioned this:

    Don’t keep clearing cache. Cache serves two functions:
    Speed up your device – your device will not have to re-do the same task again. And if cache has to be built from an online resource (think Google Photos and others), it will use internet data too, and depending on your network speed, this can lengthen the process, making your device slow.
    Extend your battery life – Yes. Cache building doesn’t come free. If your device has to rebuild cache, it will use hardware resources, networkresources, meaning battery drain.

    The above explains why deleting cache unnecessarily would cause battery drain.

    For the 1st time ever, I dirty flashed a ROM without wiping Dalvik and Cache partitions just to test. Although OP says those partitions have nothing in them anymore (which I doubt, and if true, wiping them wouldn't have any negative consequences), I have always found that the 1st time I wipe it, it takes a few seconds to complete. Subsequent wipes are instantaneous. OP hasn't explained why it takes longer the 1st time.

    That said, my device is running super smooth, and I got the best battery life from it in a long time.



    I believe this is probably due to the fact that my phone was already mostly optimised and since I didn't wipe caches this time, there was not much additional optimisation required, resulting in improved battery life. In other words, wiping cache unnecessarily would result in unnecessary battery drain.

    dsmonteiro likes this.
  2. dsmonteiro Community Consultant Community Expert Feb 8, 2019

    dsmonteiro, Feb 8, 2019 :
    As mentioned here yesterday, I never contested that clearing cache unnecessarily is useless and potentially harmless. I contest that clearing cache is always useless and harmful to the battery life (which, you don't defend but @anupritaisno1 does), but most importantly I contest most of the information provided in this thread that is not backed up by any source or hard data and that misleads people.

    My quick (and I admit, not as scientific as I'd like) test, shows that even when comparing extreme cases, the "facts" claimed by @anupritaisno1 do not hold up. Even though, according to him, clearing cache is useless and harmful and causes battery drains, I ended up getting more than a 25% increase in SOT.

  3. Sridhar Ananthanarayanan Lollipop Feb 8, 2019

    Sridhar Ananthanarayanan, Feb 8, 2019 :
    in your case, scenario B happened AFTER scenario A. there is some amount of optimisation that happened before scenario B (and during scenario A) that might have helped with better battery life. I don't think wiping cache will completely undo all optimisations. but I would leave it to @anupritaisno1 to better explain the observation.

  4. dsmonteiro Community Consultant Community Expert Feb 8, 2019

    dsmonteiro, Feb 8, 2019 :
    How is there any optimization as result of A if the first thing I did was clearing cache? That makes no sense.

  5. dsmonteiro Community Consultant Community Expert Feb 8, 2019

    dsmonteiro, Feb 8, 2019 :
    Moreover, what optimization could possibly justify an increase of more than 25% in SOT, that didn't happen before? This current build is running for at least a couple of weeks. So, even though I cleared cache, which would have a negative impact according to this thread, i still ended up far better than I was before clearing it.

    Trevor.Hawkes likes this.
  6. anupritaisno1 KitKat Feb 8, 2019

    anupritaisno1, Feb 8, 2019 :
    You can safely ignore this error. It is exactly what the previous person reported

  7. anupritaisno1 KitKat Feb 9, 2019

    anupritaisno1, Feb 9, 2019 :
    I never really expected such a case to come up

    When you optimise code your CPU can run it faster. However optimised code comes with the downside that the CPU might prefer higher frequencies running optimised code compared to unoptimised code because it can execute more of the optimised code at once

    The question boils down to: does ramping up your CPU and hitting idle faster save more battery or does a more consistent load save more battery
    Obviously giving a definite answer is not possible because it depends on the type and how many times the workload has to be processed

    And in certain cases optimised code can really push your CPU

    Try to compile a program with generic as the target CPU and you'll notice execution time is slower but CPU usage is also low

    Consider this code:
    #include <iostream>

    int main() {
    double a;
    for (a=0; a < 1000000000 ; ++a) {}
    return 0;
    Compile for generic target with g++ -O3
    The executable in my case took 2 seconds to complete and used 30% of the CPU

    Compile the same but this time g++ -O3 -march=native -mtune=native
    Basically we tell our compiler to generate the target executable for our CPU
    The executable took 1.92 seconds to complete and used 48% of CPU

    Here the time difference is small because the code is very simple and not much can be optimised

    Note: -march=native doesn't have constant results. Execution time will vary by processor type and these results will not be reproducible. On a very fast processor due to how simple the code is -O3 and the one with optimisation for the CPU will come very close or even be equal to each other

    Very rarely does this happen but yes optimised code can sometimes run faster at the cost of higher power usage. Try optimising a kernel for your PC and while performance might be better you will see your CPU fan constantly ramping up

    This does not mean you should go wipe cache and use JIT either because:
    1 this is a rare phenomenon
    2 running an interpreter and JIT during execution will have a higher chance of using more battery because you're basically running a compiler in the background
    3 you will get worse performance with JIT than with AOT

  8. Tobikage Marshmallow Feb 9, 2019

    Tobikage, Feb 9, 2019 :
    I'm just waiting for a
    '#PMChallenge : Add Wipe Cache Toggle in Status Bar' thread :D

    Neddard likes this.
  9. Neddard KitKat Feb 9, 2019

    Neddard, Feb 9, 2019 :
    Now you've done it................ :rolleyes:

    Tobikage likes this.
  10. Sridhar Ananthanarayanan Lollipop Feb 9, 2019

    Sridhar Ananthanarayanan, Feb 9, 2019 :
    I told you you have ignored several possibilities. So you may want to have a relook at the original write-up.

    Would it be right to say that the whole purpose of optimisation is speed, and not necessarily efficiency (meaning lowest use of resources, in this case battery)?

    What happens when cache is cleared? Is all the optimisation undone completely or only the in-progress optimisation undone?

  11. anupritaisno1 KitKat Feb 11, 2019

    anupritaisno1, Feb 11, 2019 :
    1 no not really

    2 this has been answered in the quoted post

    3 all of it

  12. Trevor.Hawkes Ice Cream Sandwich Feb 13, 2019

    Trevor.Hawkes, Feb 13, 2019 :
    I don't know where you learned to communicate but the lessons failed you, I have read clearer write ups on the theory of special relativity and that is saying something.

    Ok, while I don't want to get into a critique of your post I will ask for some proofs.

    Taking two things at random can you offer any support for your statement

    Thecode running behind the optimising apps screen wasn't removed however, it wasinstead run when a very specific condition was satisfied (device is plugged in,charging, full battery, turned on, is not in use and is not in motion)

    Suggesting this should be something users should be aware of and should carry out.

    And also proof for your time periods mentioned to rebuild the cache. From a few hours to a few weeks you say. Suggesting resources are being used all during that time causing problems with the phones operation.
    Last edited: Feb 13, 2019

  13. anupritaisno1 KitKat Feb 14, 2019

    anupritaisno1, Feb 14, 2019 :
    Thank you for the compliment

    The code running in the background............ An explanation is given in the post so go and read the whole thing

    Optimisation period: AOT compiling everything is wasteful. A better approach is to compile what is slow. To find what is slow a profile needs to be generated. The profile is generated as you use your phone

    Looks like you haven't read the post carefully. Read it

  14. Trevor.Hawkes Ice Cream Sandwich Feb 14, 2019

    Trevor.Hawkes, Feb 14, 2019 :
    I'm afraid it's you who has not understood.
    Let me help you.

    1. 1.
      evidence or argument establishing a fact or the truth of a statement.
    I asked for proof not further garbled explanation.
    If you read my post again I am sure you will see I wasn't complimenting you.

  15. anupritaisno1 KitKat Feb 14, 2019

    anupritaisno1, Feb 14, 2019 :
    Pretty bold of you to quote a meaning from a dictionary when you yourself can't type English

    You might want to read your own post and correct your sentences. Half of it is incomprehensible to anyone who will even try reading it

  16. Trevor.Hawkes Ice Cream Sandwich Feb 14, 2019

    Trevor.Hawkes, Feb 14, 2019 :
    As you're unable to give us any proof for those items I mentioned is it safe to assume you will not be able to offer proof for any of what you posted.

    If that is the case would you please post an apology for wasting members time.
    Thank you.

  17. anupritaisno1 KitKat Feb 14, 2019

    anupritaisno1, Feb 14, 2019 :
    Proof is already given in the OP

    What do you want proof for is the question

  18. KeepTransisting KitKat Feb 14, 2019

    KeepTransisting, Feb 14, 2019 :
    But..... but..... but I was told wiping my cache fixes everything!

    Also PUBG makes my phone very hot.....


    Holy patronizing, Batman!

    Sorry, but OP is 100% right in his findings. And if you're complaining about having your time wasted while reading a forum dedicated to cell phones, then you need to re-prioritize things.

  19. Sridhar Ananthanarayanan Lollipop Feb 14, 2019

    Sridhar Ananthanarayanan, Feb 14, 2019 :
    apology? are you serious?

    this isn't a thesis that needs to be accompanied with solid proof or mathematical evidence.

    I think you guys fail to recognise the fact that this is just a knowledge sharing community, and nothing is written in stone. take everything with a pinch of salt.

    while you are welcome to ask for proof or something more concrete to backup the claim (if I may call it so), there is no obligation on the part of the writer to provide the same, nor is anyone forced to believe in everything that is written.

    different people have different usage and therefore different experiences, and we should just take what works for us and move on.

  20. KeepTransisting KitKat Feb 14, 2019

    KeepTransisting, Feb 14, 2019 :
    Your reply wasted my time and I demand an apology ;)