Search Unity

Huge FPS drops from 60FPS ARMv7 to 25/30 FPS ARM64 - Unity 2017.4.20

Discussion in 'Android' started by mgrigorov_bg, May 21, 2019.

  1. mgrigorov_bg

    mgrigorov_bg

    Joined:
    May 14, 2016
    Posts:
    23
    Hello guys,

    We've build our game so far with ARMv7 on Huawei Mate 20 Pro and the FPS is solid 60FPS.
    After that we've tested to create a build with ARM64 architecture and the FPS drops from 60 to 25 FPS.
    It's not fixed 25 it's playing/spiking from 60FPS to 25FPS.
    version: Unity 2017.4.20

    Anyone knows what is the issue with that? In Unity blog posts it says that ARM64 will boost the performance not huge decrease it.
     
  2. superjayman

    superjayman

    Joined:
    May 31, 2013
    Posts:
    185
    Are you using Vulkan?
     
  3. mgrigorov_bg

    mgrigorov_bg

    Joined:
    May 14, 2016
    Posts:
    23
    Nope it happens on GLES3.0, GLES2.0 even in Vulkan. Tested all of them.
    However if i turn on the 32 ARMv7 build. FPS is fine.
     
  4. XCVG

    XCVG

    Joined:
    Jun 28, 2017
    Posts:
    7
    Did you switch from Mono to IL2CPP at the same time, or were you already using IL2CPP for the 32-bit build?
     
  5. mgrigorov_bg

    mgrigorov_bg

    Joined:
    May 14, 2016
    Posts:
    23
    I'm using IL2CPP for the 32bit and 64bit.
     
  6. ShpitsMedia

    ShpitsMedia

    Joined:
    Dec 10, 2016
    Posts:
    1
    Did you check what is eating up the FPS with the profiler?

    Is it CPU or GPU?

    Try to use a lower resolution (using Screen.SetResolution or "Player settings" => "Resolution Scaling Mode" with a low FixedDPI, something like 180) and check if that boost your FPS, if so then probably the GPU is working hard.

    If it doesn't boost the FPS it sometimes means that the CPU is working hard and you should check if some code should be optimized (memory allocation in Update method maybe?) or some plugin is causing the problem.

    Good luck.
     
  7. NamNH1990

    NamNH1990

    Joined:
    Mar 16, 2015
    Posts:
    8
    I have the same issue with my game. FPS in ARMv64 build drop too low, I think it is CPU problem.
     
  8. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,609
    If you're able to reproduce that it runs slow on ARMv64, but fast on ARMv7, could you please submit a bug-report as described in this document:
    https://unity3d.com/unity/qa/bug-reporting

    It's important that you report these issues together with a reproduction project if you want them to get fixed. If you don't do it, it might be a long time until someone else reports them or until Unity Technologies find them.

    After you submitted the bug-report, you receive a confirmation email with a bug-report Case number. Please post the Case number (number only, not the link) in this forum thread for Unity staff to pick up.
     
  9. divmob

    divmob

    Joined:
    Apr 21, 2017
    Posts:
    5
  10. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,609
  11. divmob

    divmob

    Joined:
    Apr 21, 2017
    Posts:
    5
    After many test, we found that build il2cpp 32bit (we tried to build il2cpp 32bit and 64bit separately) is very lag and easy to crash.
     
  12. Bulwin

    Bulwin

    Joined:
    Oct 10, 2016
    Posts:
    1
    Does anybody found a solution?
     
  13. Degree

    Degree

    Joined:
    Nov 8, 2014
    Posts:
    2
    I had the similar problem and the reason was Debug.Log. This doesn't to affect performance much for the ARM7, but for the ARM64 the impact is just huge.
     
  14. roointan

    roointan

    Joined:
    Jan 8, 2018
    Posts:
    78
    I'm experiencing an slowdown in 64bit build compared to the same 32bit build, and my devices are also Huawei (tested both on Huawei P10 lite with a kirin CPU and a G8 huawei with Snapdragon CPU)
     
  15. roointan

    roointan

    Joined:
    Jan 8, 2018
    Posts:
    78
    I tried profiling the 32bit and 64bit builds and comparing them using profile analyzer.
    I see about 40 miliseconds spent on Semaphore.WaitForSignal every single frame in the 64bit build, while the 32bit build spends nothing on it.
    This happens on the dispatcher thread.
    Any solution?
     
    mikapote likes this.
  16. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,014
    @roointan can you please submit a bug report?
     
  17. Woody991456

    Woody991456

    Joined:
    Mar 10, 2018
    Posts:
    7
    I have a similar problem: I use Unity 2019.2.6, it works well with Mono build, but laggy with IL2CPP 64-bit build(ARMv7 and ARM64). Then I found that IL2CPP 64-bit lag happens on some devices, the other work fine.

    I used Firebase Test Lab to test my IL2CPP 64-bit apk, and I got the following result:

    1. Samsung Galaxy S3(API level 18): Laggy
    2. Pixel 2(API level 28): Normal
    3. Razer Phone(API level 25): Normal

    It is also laggy on my old phone Samsung Galaxy S2 with IL2CPP, the game almost freezed with 64-bit while it had roughly 40 FPS with 32-bit running. I don't think the problem is from the optimization of my game, because it couldn't explain why it runs well with 32-bit build and has huge lag with 64-bit build on the same phone.

    Still, I can't make a conclusion saying that latest devices do not have this issue, because I borrowed a Nvidia tablet with Android 7.0 to test, it had less than 15 FPS, completely unplayable. Hopefully I will find the reason after testing more devices.
     
  18. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,900
    Check if you're printing any logs during your game, there's a known issue that stacktrace resolving is much slower on ARM64 than ARMv7 (stacktrace resolving happens when you print something to log), you can disable stacktrace resolving in Player Settings under Stacktrace Logging
     
    angganaro3 and Marco19041 like this.
  19. Woody991456

    Woody991456

    Joined:
    Mar 10, 2018
    Posts:
    7
    Hi Tomas1856, I already did that since the beginning of the development. I knew that it will produce extra overhead, no matter which ARM is. I turned it off on both Android and iOS. The lag issue still exists. The apk I tested is a release version, so I won't put console log anywhere.

    Screen Shot 2019-09-29 at 4.36.23 PM.png

    Also I did another Firebase testing, I got the following result:

    1. Pixel 3(API level 28): Very smooth
    2. LG G3(API level 19): Normal
    3. HTC U11(API level 26): Normal

    I still have no clue, this time all these 3 devices run smoothly. Some devices have this issue, some don't have. I have never seen this lag with Mono build, but for IL2CPP 64-bit build, it probably happens, depending on which device.

    And I'd like to describe the lag a little more: It doesn't look like the lag of unoptimized rendering, it is laggy even when I turn the camera facing to an empty place(no 3d objects except for a flat plane, and a skybox).

    If you have any solution, please let me know.
     
  20. Woody991456

    Woody991456

    Joined:
    Mar 10, 2018
    Posts:
    7
    I continue testing different devices using Firebase Test Lab:

    1. Nexus 7 2013(API level 19): Normal
    2. Samsung Galaxy S3(API level 18): Frame rates are fine, but the graphics look like in X-ray
    3. Galaxy S7 edge(API level 23): Normal
    4. Galaxy Note 9 USA(API level 27): Normal
    5. Huawei Mate 9(API level 24): Normal
    6. Moto X(API level 19): Didn't reach 60 FPS, but basically worked fine
    7. LG K4(API level 23): Supper laggy
    8. Nexus 5(API level 21): A little bit laggy
    9. Galaxy Note 3 Duos(API level 19): Abnormally flashing, including UI and 3D objects

    I would say that this problem isn't related to API level. A high API level cannot guarantee it is error-free. I believe that IL2CPP 64-bit build is still not as stable as Mono build.
     
  21. ThatStevenGuy

    ThatStevenGuy

    Joined:
    Jan 30, 2014
    Posts:
    5
    Hey everyone. We've been experiencing the same issue with Unity 2018.4, 2019.1 and 2019.2. The performance issue seems to happen only on Android ARM64 IL2CPP builds. ARMv7 IL2CPP performs absolutely fine, but because of the Google Play 64-bit requirement we can't fall back to using 32-bit builds only. We have created a bug ticket for this issue on which can be found here.

    From what we can tell this is a known issue and has been fixed in Unity 2017.4 according to this ticket, but the fix has not been ported to Unity 2018 and above. At this point we can not downgrade to Unity 2017, so we're kinda stuck with bad performance on select few devices. For us, the issue seems to come from Physics.Processing creating enormous spikes several times per second which makes for a very poor gameplay experience.

    Hopefully the issue can be resolved soon because we're receiving a lot of complaints regarding performance since we pushed out our ARM64 builds.
     
  22. dustinkerstein

    dustinkerstein

    Joined:
    Jan 26, 2017
    Posts:
    16
    Can anyone else confirm this issue is only reproducible in Unity 2018/2019 and not the latest versions of 2017 LTS? As the subject of this issue notes, it appears that it was an issue in earlier 2017 versions (2017.4.20). It looks like from the ticket mentioned (1120019), it was fixed in 2017.4.0, which indicates that we may be talking about multiple ARM64 bugs.
     
  23. ThatStevenGuy

    ThatStevenGuy

    Joined:
    Jan 30, 2014
    Posts:
    5
    We haven't tested on Unity 2017.4 so I can't say for certain if it suffers from the same bug or not. It seems a new ticket has opened up on the Unity issue tracker (check it out here) which indicates the issue was also found in Unity 2017.4 (assuming it's the same bug). The ticket is currently active, hopefully it'll be resolved soon.
     
  24. muhammad_ali_safdar

    muhammad_ali_safdar

    Joined:
    Jan 7, 2015
    Posts:
    15
    I have the same issue with my game. FPS in ARMv64 build drop too low, But fine in Armv7 .
    Edit : just found a temporary solution , disable all Debug.Log messages so now fps same on both architectures .
     
    Last edited: Oct 22, 2019
    Marco19041 likes this.
  25. muhammad_ali_safdar

    muhammad_ali_safdar

    Joined:
    Jan 7, 2015
    Posts:
    15
    Yah that's issue i think .
     
  26. o1o101

    o1o101

    Joined:
    Jan 19, 2014
    Posts:
    639
    Interesting stuff, I am seeing similar behavior, going to test some things out now.
     
  27. suatss

    suatss

    Joined:
    Jul 30, 2015
    Posts:
    2
    I have same issue, 2019.2 arm64 laggy, sometimes crashing and looks not convenient
     
  28. darsan1991

    darsan1991

    Joined:
    Apr 14, 2014
    Posts:
    2
    Disabling Stack Trace Logging Fix my Problem. Thanks
     
  29. KacperFHolo4Labs

    KacperFHolo4Labs

    Joined:
    Aug 14, 2019
    Posts:
    7
    Im Working with Hololens the problem is that builds on Hololens 1 works perfectly, yet builds for Hololens2 require ARM architecture and disabling a stacktrace doesn't help. Does anyone found any other solutions?
     
  30. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,900
    Isn't Hololens 2 Windows only?
     
  31. KacperFHolo4Labs

    KacperFHolo4Labs

    Joined:
    Aug 14, 2019
    Posts:
    7
    Yes hololens is Windows only, and it is build On UniversalWindowsPlatform with il2cpp.
    Hololens 1 requires your build to be x86 or x64
    Hololens 2 requires build to be ARM or ARM64
    And we have a dramatic frame drop. When debug stack is enabled single error crashes whole app when it tries to output a stacktrace(so disabling it gave us a slight boost). From stable 60 -58 fps we went to 50-25 fps. By my guess the problem lies in processor architecture.
    I already did perform a downgrade from 2019 to 2018.4.10 LTS (it was quiet hard). That gave us some improvements yet we still cant reach 60 fps
     
  32. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,900
    The thread above describes issues on Android, I doubt above problems are related to Windows
     
  33. KacperFHolo4Labs

    KacperFHolo4Labs

    Joined:
    Aug 14, 2019
    Posts:
    7
    Thanks then I'll try to dig this thing on my own :)
     
  34. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,900
  35. perza

    perza

    Joined:
    Jun 30, 2013
    Posts:
    7
    This problem is still valid in 2019.3.6f1. When I change scripting backend from Mono to IL2CPP 64 bit, without changing anything else, the fps drops from 40 to 10. Stacktrace debugs are off. Profiler results are _relatively_ the same: meaning the same methods take most time in both builds, but in 64 bit build everything takes about 4 * more time.
     
    Last edited: Mar 21, 2020
  36. mgrigorov_bg

    mgrigorov_bg

    Joined:
    May 14, 2016
    Posts:
    23
    Anyone manage to solve the problem? I've updated to 2019.3.4 but FPS still bad on 64bit build.
     
  37. perza

    perza

    Joined:
    Jun 30, 2013
    Posts:
    7
    I just realized that the issue is not only with 64 bit, but also 32 bit IL2CPP build suffers from the significantly lower performance. Only Mono build runs as expected.
     
  38. frank231love

    frank231love

    Joined:
    Jun 2, 2019
    Posts:
    22

    I am also troubled by this problem Does anyone have a better solution?
     
    ShadowAngel likes this.
  39. mgrigorov_bg

    mgrigorov_bg

    Joined:
    May 14, 2016
    Posts:
    23
    Lets open a bug report together and vote on it?
     
    ShadowAngel likes this.
  40. ShadowAngel

    ShadowAngel

    Joined:
    Aug 7, 2012
    Posts:
    12
    Same here, after updating project to 2019.3.5f from 2019.2.6f we had 50% fps drop on android. Mono windows did not suffer any fps drop.
    Settings we use are ARMv7/ARM64 IL2CPP. Disabled all stacktrace except errors.
    We did try to use different GPU APIs. Did not help. Il update you, if i find something important.
     
  41. erfannik

    erfannik

    Joined:
    Jul 24, 2018
    Posts:
    1
    I have a similar issue on 2019.3.14. The game runs fast on my Sony Z1 (ARMv7) and slow on Samsung Galaxy J7 and Huawei P Smart (both ARM 64). But the thing is whether I build Mono or IL2CPP the result is the same. Also I have noticed they both have Mali-T830 GPU.
    I'm using 2D Lights but I don't think that is the problem.
    Did anyone find a solution? I disabled Stack Trace options and also OpenGLES2 solution did not work.
     
  42. roointan

    roointan

    Joined:
    Jan 8, 2018
    Posts:
    78
    I had this problem on Huawei P10 Lite with the same GPU
    But also on Huawei G8, with Adreno 405 GPU
     
  43. Behaviour

    Behaviour

    Joined:
    Oct 4, 2015
    Posts:
    10
    We're still experiencing this issue in Unity 2019.4.5f1 using an ARM64 IL2CPP build. Testing on an Samsung Galaxy S7 gives us buttery smooth 60fps but testing on an Huawei Mate 20 Lite yields 25 fps. However, when we do a Mono build we achieve 60fps on both devices. Since Mono only supports 32-bits it is not an option for us due to the Google Play Store 64-bit requirement so we hope this gets picked up soon.
     
  44. HasithaCJ

    HasithaCJ

    Joined:
    May 20, 2017
    Posts:
    11
    any fix?
     
  45. IAmChiagozie

    IAmChiagozie

    Joined:
    Jun 26, 2017
    Posts:
    37
    Have you guys fixed it yet? What did you do?
     
  46. big_3

    big_3

    Joined:
    Apr 20, 2016
    Posts:
    88
    We have the same issue. Any updates?
     
  47. unity_udviTXgoK4Ualw

    unity_udviTXgoK4Ualw

    Joined:
    Apr 10, 2019
    Posts:
    1
    Application.targetFrameRate = 60
     
  48. kimobm

    kimobm

    Joined:
    Dec 20, 2019
    Posts:
    26
    Same here ! Strange how it isn't fixed yet after all these years -_- Especially when 64 bit is now essential to Release on Google Play !
     
    muusi likes this.
  49. Marcos-Elias

    Marcos-Elias

    Joined:
    Nov 1, 2014
    Posts:
    159
    I got huge improvements on Galaxy A20S while doing it:

    * Avoid ANY garbage generation on Update, LateUpdate, FixedUpdate, OnTriggerStay or any other function that repeats a lot. Garbage generated via temporary objects or strings seems to be waaay worse on 64-bit for Android with this problematic il2cpp/native code.

    * Avoid ANY try... catch blocks on the same Update functions (it's ok using them on loading, not during normal gameplays). My project has mods created by users, so I was using a lot of try... catch inside Update functions. That's really bad! I got rid of many of them and the 64-bit performance got way better. If you are not sure if some object exists or not, make more comparisons with ==null instead of relying on catch... when possible.

    * At Player Settings - Logging, set everything to None (you may do it through code if you need to enable those items at runtime for some parts of your game).

    This problem seems to be with something on Unity or on the System, since it does not happen with the same intensity on all devices. But it may affect many popular devices out there. On some devices the game became just unplayable at 4, 3fps... It's hard to debug if it does not happen on your device. My team tested a lot on Galaxy S8, S9, S10, S20, J7 Prime, Moto G5, G5S, G6... and could not reproduce it properly. So I bought some devices that users reported: Moto G6 Play or Plus, Galaxy A20S... And voila: the bad performance was there!

    Unfortunately since the last year I had to process many refunds and bad reviews due to this problematic update. My game went from 30~60 fps to 3~11 on many popular devices. It should never happen! Google should allow a more flexible time for 32-bit apps until il2cpp become more stable, since Unity is one of the most famous engines used by thousands of popular games... We were forced to use an unstable software in production, something really not great for companies of that size...

    Garbage generation and the try... catch seems to be a lot slower on 64-bit Android builds. I'm refactoring many parts of my code and now the game runs better. Not as good as 32-bit Mono builds, but much better than 64-bit builds before.
     
    Last edited: Dec 2, 2020
  50. parag1111

    parag1111

    Joined:
    May 2, 2017
    Posts:
    3