Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Optimize dependency context memory usage #2264

Merged
merged 1 commit into from
May 16, 2016
Merged

Conversation

pakrym
Copy link

@pakrym pakrym commented Apr 4, 2016

  1. Pool strings
  2. Do not hold onto DependencyContextJsonReader in DependencyContextLoader
  3. Use same reader with same string pool to load multiple contexts in case of portable app.

Brings DependencyContext size in ASP.NET app to ~250kb.

/cc @davidfowl


This change is Reviewable

@krwq
Copy link
Member

krwq commented Apr 4, 2016

What's the previous DependencyContext size?

@pakrym
Copy link
Author

pakrym commented Apr 4, 2016

~550kb

@pakrym
Copy link
Author

pakrym commented Apr 4, 2016

@dotnet-bot Test CentOS7.1 x64 Debug Build Please

@@ -12,6 +12,8 @@ namespace Microsoft.Extensions.DependencyModel
{
public class DependencyContextJsonReader : IDependencyContextReader
{
private readonly IDictionary<string, string> _stringPool = new Dictionary<string, string>();

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@pakrym
Copy link
Author

pakrym commented Apr 5, 2016

@dotnet-bot test Windows_NT x86 Debug Build please

@pakrym
Copy link
Author

pakrym commented Apr 28, 2016

@dotnet-bot test Windows_NT x86 Debug Build please
@dotnet-bot test CentOS7.1 x64 Debug Build please

@eerhardt
Copy link
Member

@pakrym - this has conflicts. Are we still interested in taking this change? If so, can you resolve the conflicts? If not, please close.

@pakrym
Copy link
Author

pakrym commented May 11, 2016

Are you taking preview2 changes already?

@eerhardt
Copy link
Member

As of last night rel/1.0.0 is open for business for preview2. We have branched preview1 to rel/1.0.0-preview1.

@pakrym
Copy link
Author

pakrym commented May 11, 2016

I'll rebase this change then

@pakrym pakrym force-pushed the pakrym/dc-memory branch from bd467a7 to 04926a4 Compare May 11, 2016 23:14
@pakrym pakrym force-pushed the pakrym/dc-memory branch from 04926a4 to 43c638e Compare May 11, 2016 23:14
@pakrym
Copy link
Author

pakrym commented May 16, 2016

/cc @anurse


public DependencyContextLoader() : this(
DependencyContextPaths.Current.Application,
DependencyContextPaths.Current.SharedRuntime,
FileSystemWrapper.Default,
new DependencyContextJsonReader())
() => new DependencyContextJsonReader())
{
}

internal DependencyContextLoader(

This comment was marked as spam.

This comment was marked as spam.

@eerhardt
Copy link
Member

:shipit:

@pakrym pakrym merged commit 07b785c into rel/1.0.0 May 16, 2016
@eerhardt eerhardt deleted the pakrym/dc-memory branch May 16, 2016 17:57
wli3 pushed a commit to wli3/cli that referenced this pull request Nov 14, 2018
Enable x-plat net46 build using framework reference assemblies from NuGet
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants