Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Mono Upgrade Future plans for the Mono runtime upgrade

Discussion in 'Experimental Scripting Previews' started by JoshPeterson, Apr 3, 2017.

  1. Qbit86

    Qbit86

    Joined:
    Sep 2, 2013
    Posts:
    487
    Unity 2018 Episode 3, iyswim :)
     
  2. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    1,163
    Now it released and it worked!
     
  3. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    Has there been progression on new GC in ways that we could expect some experimental versions soon? Also if you use IL2CPP, I'm guessing we still get the old Boehm or does it use some other solution then under the hood?
     
  4. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    Mono and IL2CPP both use the same Boehm GC, which is our fork of the latest Boehm code. We have made a good bit of progress on incremental GC, but it is not ready for experimental versions just yet. We're continued to work on it though.
     
  5. Qbit86

    Qbit86

    Joined:
    Sep 2, 2013
    Posts:
    487
    A little bit offtopic, but anyway. If you are suffering from memory pressure on legacy GC, give a try to package Misnomer.Rist (Don't forget to download its dependency System.Buffers manually since Unity does not support NuGet packages and resolving their dependencies.) It is intended to be used instead of conventional List<T> like in ToList() call. Using ArrayPool<T>.Shared internally can significantly reduce allocations.
     
  6. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    Thanks, but in that specific case I'd just use new NativeArrays (https://jacksondunstan.com/articles/4713).

    My interest on more efficient GC isn't really for new code but for things that exist on other codebase that I'm already using (obviously ideal approach would be to fix all that manually). I do hope we'll get newer GC eventually as for outsider it seems like it's not been lately a huge priority to Unity and it's not been discussed that much anymore (before ECS and "performance by default", this topic seemed to have bigger importance in general).

    Obviously the work Unity has done recently to reduce unneeded allocations on new systems is important but it doesn't carry to legacy code bases, hence wondering where GC upgrade is going atm.
     
    dadude123 likes this.
  7. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    789
    We want to use IValueTaskSource in Unity, but from what I understand it's not available in Unity (only .net core 2.1).
    Could this type (and all the related ones) be added to unity?
    From what I understand supporting it wouldn't require any runtime or jit changes (unlike span).
     
    Qbit86 likes this.
  8. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    Currently no, we cannot add this to Unity. It looks like this will be a part of .Net Standard 2.1 though (see https://apisof.net/catalog/System.Threading.Tasks.Sources.IValueTaskSource). We do plan to support .NET Standard 2.1 in Unity, so it should be available eventually.
     
    MechEthan, dadude123 and Qbit86 like this.
  9. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    789
    I see, that is good news!
    But it looks like Span<> will be part of net standard 2.1 as well, and in order to be actually useful that will require some runtime changes, is that something unity is going to do? Or will span be a special/slow case like in .net framework?
     
    Qbit86 likes this.
  10. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    We're planning to make the necessary runtime changes to support .NET Standard 2.1.