Skip to content

Reduce number of runtime assemblies that a typical app has to load #2138

@jkotas

Description

@jkotas

For histroric reasons, .NET Core runtime has many small facades and partial facades that do not serve any meaninful purpose anymore. We should consider merging some of them to reduce number of assemlies that a typical app has to load. Unfortunately, we cannot delete them because of backward compatibility.

Example of merged facade looks like: System.AppContext. Notice that ref has type-forwards only and src has no implementation files.

List of proposed merges:

  • Merge into System.Private.CoreLib\src:

    • System.Threading.Thread\src
    • System.Diagnosics.Tools\src
    • System.Security.Principal\src
    • System.Runtime\src
    • System.Runtime.Extensions\src
  • Merge into System.Runtime\ref:

    • System.Buffers\ref
    • System.Diagnosics.Debug\ref
    • System.Resources.ResourceManager\ref
    • System.Runtime.Loader\ref
    • System.Text.Encoding.Extensions\ref
    • System.Threading.Tasks\ref
    • System.Threading.ThreadPool\ref
    • System.Threading.Timer\ref
    • System.Threading.Thread\ref
    • System.Diagnosics.Tools\ref
    • System.Security.Principal\ref
    • System.Runtime.Extensions\ref
  • Misc other cleanup

    • Stop building packages for System.Reflection.Emit.*
    • Stop building packages for System.Reflection.TypeExtensions
    • Simplify build configurations for implementations that just foward to other contracts (e.g. System.AppContext\src can have just a single configuration)
    • Delete System.Reflection.Emit.*\src\Resources\Strings.resx
    • Delete System.Buffers\src\Resources\Strings.resx
    • Delete System.Threading.Timer\src\ApiCompatBaseline.uapaot.txt
    • Merge System.Reflection.Emit.\ref\System.Reflection.Emit..netcore.cs into System.Reflection.Emit\ref\System.Reflection.Emit.*.cs
    • Delete System.IO.UnmanagedMemoryStream\ref\System.IO.UnmanagedMemoryStream.cs
    • Delete System.Reflection\ref\System.Reflection.cs
  • Wave 2: It is less obvious that the merging is a good idea for these (big enough, platform specific, etc.) We may still do some merging for them, based on the experience from the Wave 1 above:

    • System.Diagnostics.Contracts
    • System.Diagnostics.Tracing
    • System.Numerics.Vectors
    • System.Reflection.Emit
    • System.Reflection.Primitives
    • System.Threading.Overlapped
    • System.Memory
    • System.Reflection.TypeExtensions
    • System.Threading
    • System.Collections
    • System.Collections.Concurrent

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions