Search Unity

IL2CPP - slow performance

Discussion in 'Android' started by jeremy_crowell, May 15, 2019.

  1. jeremy_crowell

    jeremy_crowell

    Joined:
    Jul 21, 2018
    Posts:
    83
    After upgrading game to 64-bit(google requirement) the performance of game went down at least 10 times. While 32-bit version of game performs without any problem even on cheap mobiles(100$ worth). Is there any chance to solve this issue?

    I'm trying to debug the game now but it's very difficult, every apk generation takes more then 5 mins.

    Any ideas?
     
    perza likes this.
  2. muhammad_ali_safdar

    muhammad_ali_safdar

    Joined:
    Jan 7, 2015
    Posts:
    15
    Same here , Any solution ...?
     
  3. WazupGames

    WazupGames

    Joined:
    Sep 7, 2019
    Posts:
    10
    Bump! I wanted to create a thread with almost the exact same words the OP uses! In my case though the game begins with a smooth FPS but suddenly drops to about half the amount after a while. Testing with mono builds gives no such issue indicating that this is not a result of a leakage of some sort.
     
  4. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,799
    This sounds like thermal throttling.
     
  5. WazupGames

    WazupGames

    Joined:
    Sep 7, 2019
    Posts:
    10
    But why does it only happen with IL2CPP? Also i can't feel much heat from the device. Even locking the phone while the game is running and coming back to it in few minutes (supposedly letting the phone cooldown) does not give a higher fps. But say this was the cause.. how would i go on about fixing it? i literally wanna try anything to get rid of this issue as soon as possible
     
  6. kaarloew

    kaarloew

    Joined:
    Nov 1, 2018
    Posts:
    360
    Did you check the adb logcat to see if there are errors or warnings?
     
  7. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    836
    pizzaritafromdota likes this.
  8. vagelis199

    vagelis199

    Joined:
    Jul 27, 2012
    Posts:
    183
    Interesting. just tested it and it seens removing the Debug.Logs fixed the performance issue.
     
  9. Fiveminlabplus11

    Fiveminlabplus11

    Joined:
    Feb 28, 2020
    Posts:
    1
  10. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,920
    Sadly, due big code differences 2018 versus 2019, the fix won't be backported to 2018, you either need to disable/remove Debug.Log* functions or alternatively go to Player Settings and set StacktraceLogType to None for every Error type.
     
    pizzaritafromdota likes this.
  11. hammoohammad

    hammoohammad

    Joined:
    Dec 8, 2015
    Posts:
    12
  12. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    In my experience retrieving the stack trace in Unity can be very slow on consoles too, so not only Android. So you might want to have a build preprocessor script that disables stack traces for non-expection log messages.

    For console platforms, where shipping builds don't wrote to the log output at all, we use a wrapper to the Debug class which uses conditional attributes to strip the calls in shipping builds (since Unity would still have to build the log messages that go nowhere).

    If you do use some sort of custom log interception (like remote logging) and needs the call stacks, you have to be judicious with your logging and avoid logging every frame and similar.
     
    Ryiah likes this.