1. Are you ready for the Galaxy S20? Here is everything we know so far!

major speed difference between devices with the same Android version

Discussion in 'Android Development' started by RIdge de Waal, Jun 29, 2020.

  1. RIdge de Waal

    RIdge de Waal Lurker
    Thread Starter

    For an application we need to toggle the flash LED of the mobile as fast as possible.

    In a for loop the flash LED is toggled 100 times.

    We noticed a 4 time speed difference between different devices running the same Android version (version 9).

    What is strange is that the device with higher specifications (an 8 core Samsung Galaxy J7 duo) performs 4 times slower than a 4 core device made of a different brand. (both devices have similar clock speeds).

    Note that both devices were brand new "virgin" devices with no apps installed on them.

    Can somebody explain this difference
     


  2. Disrop

    Disrop Lurker

    The speed is determined not only by the Android version but also by the components of the devices themselves
     
    puppykickr, ocnbrze and Dannydet like this.
  3. RIdge de Waal

    RIdge de Waal Lurker
    Thread Starter

    Dear Disrop,
    I was under the impression that the flash LED is directly controlled by a pin of the processor. Even if the hardware is different between devices I expect the delay in the same device to be constant without jitter. I suspect that garbage collection could cause this jitter but I am not sure exactly what triggers such garbage collection and how long it takes.as it seems to be quite random this jitter. Our main goal is to have the LED toggles at constant intervals with as little jitter as possible.
     
  4. Hadron

    Hadron Smoke me a kipper...
    VIP Member

    Is the J7 higher spec? Marketing people love to tell you that one number defines performance or quality, be that clock speed, megapixel count or number of cores, but it is never that simple. What types of cores are they? And given that this is not something that will be split over multiple cores, how fast is an individual core (assuming that is even the limiting factor, which as said above isn't that likely)?

    Also unless they were both closely related devices the android implementations are not equivalent even if they are the same version. Pick up a Samsung and a Pixel running the same Android version and they are visibly very different. Look at the numbers of apps that come pre-installed, or the tasks running in the background, and these are also different. Different manufacturers (Qualcomm, Samsung, Huawei, MediaTek) may make SoCs based on the same core architecture, but the way that things like task scheduling are done can make a big difference to performance. Even the same chip in different phones from the same manufacturer may perform differently if one chassic gives better heat dissipation than another.

    What I'm saying is, there really is a lot more to phone performance generally than number of cores and android version.

    As for causes of jitter in something like this, I'd be a little surprised if garbage collection was the answer when this presumably only takes a few seconds to complete: if it's a software thing I'd guess it more likely contention with other processes, but that really is only a guess. So I'm afraid I don't know the answer here, just pointing out that some of the assumptions in the first post are a little simplistic.
     
    puppykickr likes this.
  5. RIdge de Waal

    RIdge de Waal Lurker
    Thread Starter

    The Samsun J7 dua has an Octo core Exynos 7870 running at 1.6Ghz.
    The Dodgee S40 Lite has a 4 core Mediatek processor running at 677Mhz.

    So when it comes to specs the Dodgee does not look to good. What is interesting however is that the Samsung comes with 48 background services installed were the Dodgee seems to have none installed (Stock android ?).
    Maybe this has something to do with it.

    My problem is I want to toggle the LED at a predictable time as possible. I do not know if there is a way to issue a timer call back which gives me a reasonable predictable time. I was thinking of some frame rate update call back, but I did not find an api which implements such a call back. Flutter claims a 60hz frame rate which means every 16ms a frame which would be good enough for me.
    Another solution might be to create something which gives this toggling routine a higher priority than other (back ground) processes. Again here I lack the knowledge about this subject.
     
  6. You might be able to run the loop on a new thread. In the loop, put a timer after sending the signal out for your desired frequency.
     
  7. Hadron

    Hadron Smoke me a kipper...
    VIP Member

    "Stock android" has background services running as well, so I'm very suspicious of a phone that claims to have none.
    That said, Samsung do tend to stuff their phones with more junk than anyone else.

    Core clock speed is still not enough to judge which processor is more powerful (clock cores with different architectures at the same speed and you can still get very different results), but if they are only clocked at 677MHz that is clearly a seriously old design!
     
    puppykickr likes this.
Loading...

Share This Page

Loading...