Search Unity

Performance regression in Unity 2018.3.5f1

Discussion in 'Handheld AR' started by coder89, Mar 11, 2019.

  1. coder89

    coder89

    Joined:
    Oct 26, 2018
    Posts:
    17
    Hi,

    I am working on an AR app and today I upgraded my Unity build from 2018.3.4f1 to 2018.3.8f1 and I could notice significant performance degradation without any code changes (only rebuilding the solution after cleaning the repo).

    This issue appears as very unstable tracking. When rotating the device, both rendered points cloud and rendered planes feel to be lagging behind significantly (when shaking the device planes appear very wobbly). Although, I could not see the camera frame drop during my tests - it's just tracking that is affected.

    I verified all Unity builds since 2018.3.4f1 until 2018.3.8f1 and is seems the regression happened in version 2018.3.5f1.

    Not sure if this is a wider issue affecting other components of Unity Engine but AR Foundation is definitely the one.

    Could someone from Unity Team confirm whether this is a known issue or not?

    Thanks!
    Lukasz
     
  2. coder89

    coder89

    Joined:
    Oct 26, 2018
    Posts:
    17
    Forgot to mention I was testing on Android device running ARCore (LG V30+)
     
  3. tdmowrer

    tdmowrer

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    480
    I don't believe it is a known issue, no. Could you please log an issue and attach a small project that demonstrates the performance drop?
     
  4. lightup_alpha

    lightup_alpha

    Joined:
    Jan 11, 2019
    Posts:
    3
    We are experiencing the same issue and have isolated the problem to a performance regression between 2018.3.4f1 (works as expected) and 2018.3.7f1 (performance drop). We are also using AR foundations in the project.
     
  5. BuoDev

    BuoDev

    Joined:
    Nov 28, 2018
    Posts:
    28
    Yup, definitely a bug. Lol wasted a lot of time wondering what I did wrong.
     
  6. tdmowrer

    tdmowrer

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    480
    Hi folks,

    A quick test does not reveal any performance regressions. Has anyone on this thread used the Unity Profiler to see where the extra time is being spent? If anyone has a logged a bug with a project that reproduces the issue, please post the issue number here.
     
  7. BuoDev

    BuoDev

    Joined:
    Nov 28, 2018
    Posts:
    28
    Hi,

    Sorry for taking so long. The issue persists in 2018.3.11.
    I did not test all versions, but in 2018.3.4 everything works correctly.

    In the following demonstrations, I downloaded the entire arfoundation-samples repo and used the SampleUXScene.
    I did absolutely nothing else than switch the prefab to a heavier beetle model to exaggerate the effect.

    I believe you weren't able to notice the regression, because you were using such simple models? In both of these videos there should be a total of just under 700000 vertices after instantiating 30 beetles. Thats what it takes to really see whats happening.

    Here is a demonstration in 2018.3.4


    Here is a demonstration in 2018.3.11


    Notice the lag in the later. You should be able to quickly reproduce this.
     
  8. Fl0oW

    Fl0oW

    Joined:
    Apr 24, 2017
    Posts:
    17
    Can confirm that we are seeing the exact same problem, appeared after 2018.3.4 and is still present in 2018.3.11. We tested it building with 2018.3.4 and it worked fine again, without changes in our code or project.
     
  9. BuoDev

    BuoDev

    Joined:
    Nov 28, 2018
    Posts:
    28
    I just did a bug report.
    (Case 1143372) ARfoundation performance regression
     
    Saicopate and Fl0oW like this.
  10. sdomenici009

    sdomenici009

    Joined:
    May 7, 2013
    Posts:
    7
    I just discovered that the same behaviour exists in 2018.3.4f1 when the Tracked Pose Driver's Update Type is set to Update instead of Update and Before Render or Before Render.

    Hopefully this helps track down the issue. Something may have changed in newer versions of Unity in relation to when the tracked pose driver updates and when the camera renders.
     
  11. tdmowrer

    tdmowrer

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    480
    Thank you all for the repro steps and reports! That should give us enough to investigate for now. I'll let you know when we have more information.
     
  12. BuoDev

    BuoDev

    Joined:
    Nov 28, 2018
    Posts:
    28
  13. coder89

    coder89

    Joined:
    Oct 26, 2018
    Posts:
    17
    ARFoundation 2.1 and Unity 2019.1 works for me without the issue.
     
  14. m3rt32

    m3rt32

    Joined:
    Mar 5, 2013
    Posts:
    48
    It still happens with ARFoundation 1.x on latest 2018 and 2019.1
     
  15. coder89

    coder89

    Joined:
    Oct 26, 2018
    Posts:
    17
    Yep. Try upgrading AR Foundation packages to 2.1 and problem will go away. It is some work due to API changes but it is worth it as performance is slightly improved as well.
     
  16. m3rt32

    m3rt32

    Joined:
    Mar 5, 2013
    Posts:
    48
    I gave a shot when ARFoundation 2.0 first introduced and it was laggy. So you're saying, it is nice again with 2.1 ?
     
  17. coder89

    coder89

    Joined:
    Oct 26, 2018
    Posts:
    17
    Yes, I did not find any perf issues with 2.1 + 2019.1.3f combo. But that of course could be specific to my project and yours could have issues still (maybe worth profiling it then?).
     
  18. m3rt32

    m3rt32

    Joined:
    Mar 5, 2013
    Posts:
    48
    I'll give it a shot to upgrade our codebase with that then. Ty.