Search Unity

Resolved IL2CPP on Oculus Quest increases drawcall count by 3-4x

Discussion in 'General Graphics' started by cortopia-tobias, Apr 13, 2021.

  1. cortopia-tobias

    cortopia-tobias

    Joined:
    Sep 21, 2020
    Posts:
    7
    This was previously posted here https://forum.unity.com/threads/4x-...vs-mono-on-oculus-quest.1091761/#post-7030531, but since it also affects builtin pipeline, I post it here as well.

    In both 2019.4.16 and 2020.3.3, we are seeing drawcall count increase and GPU-performance drop when building with IL2CPP instead of Mono for Oculus Quest (Android).

    This happens both on URP and on builtin pipeline (increase was 4x on urp and 3.4x on builtin).

    Here is a profile using URP that also shows that frame times are affected:

    Mono:



    IL2CPP:
    (25% lower CPU usage, but 70% higher GPU usage)




    Is il2cpp simply not recommended for Oculus Quest?
     
  2. cortopia-tobias

    cortopia-tobias

    Joined:
    Sep 21, 2020
    Posts:
    7
    Found it!

    If I uncheck "Strip Engine Code" in player settings, I get the good GPU performance even with IL2CPP enabled! Seems that the batching code (both scriptable pipelines and builtin) is loaded dynamically by the engine at runtime, and if it got stripped it just falls back to silently NOT do any batching?!

    So beware of that default checked "Strip Engine Code" flag. It seems to mean "do you want a lesser engine".

    upload_2021-4-14_9-30-9.png
     
  3. Sky77

    Sky77

    Joined:
    Jan 30, 2014
    Posts:
    171
    It sounds crazy to me that this is the cause for the problem. Can someone from Unity confirm it?
     
    Genebris and AzurySimon like this.
  4. Travistyse

    Travistyse

    Joined:
    Mar 14, 2016
    Posts:
    8
    What stripping level do you use? Minimal, Low, Medium, or High?