Search Unity

Discussion .NET 7 support

Discussion in 'General Discussion' started by DevDunk, Jul 1, 2022.

Thread Status:
Not open for further replies.
  1. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,060
    Just saw that .NET 7 has great performance improvements to reflection, which is used a lot in Unity. When do you think we will see these improvements?

    Source:
     
  2. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,161
    .NET 7 is still in preview. Like, Preview 1 only came out in February.
     
    Acissathar likes this.
  3. karliss_coldwild

    karliss_coldwild

    Joined:
    Oct 1, 2020
    Posts:
    602
    You need to learn the difference in between the the C# the language (and it's features), .Net bytecode format, and the .NET VM/runtime (there are multiple implementations of it) which runs the compiled code.

    Unity is still using Mono and it's own IL2CPP for executing .Net code depending on target configuration. Just because sooner or later Unity gets some of the C# language features introduced by new .Net version doesn't mean that Unity will get the performance optimizations done in Microsoft implementation of .Net runtime (because Unity isn't using it).

    There are cases where performance improvements are being made possible by new language features, better standard library API or new bytecode instructions, in those cases there is hope that Unity will also benefit from them. But in case of many runtime improvements they are not relevant for Unity.

    Now that Microsoft has open sourced latest versions of .Net runtime. Unity in theory could switch to it from Mono. But that will probably take a lot of work due to the integration with engine and editor tooling. It would also not eliminate IL2CPP as from what I understand that is at least partially motivated by JIT restrictions and lack of support on mobile and console platforms.
     
  4. runner78

    runner78

    Joined:
    Mar 14, 2015
    Posts:
    792
    This is quite relevant for Unity, since Unity is already actively working on implementing the core CLR as the runtime.
     
    Deleted User and JuanuMusic like this.
  5. JuanuMusic

    JuanuMusic

    Joined:
    Sep 23, 2018
    Posts:
    3
    Im just gonna leave a message to be notified when there are news about this....
     
  6. Max-om

    Max-om

    Joined:
    Aug 9, 2017
    Posts:
    499
    If they get .NET 6 sorted migrating to .NET 7 should be a breeze. Unless they Frankenstein their own version of .NET 6 from the source like they did mono
     
    AldeRoberge and DevDunk like this.
  7. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
Thread Status:
Not open for further replies.