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

Performance Fixes #3942

Closed
wants to merge 16 commits into from
Closed

Conversation

brthor
Copy link

@brthor brthor commented Jul 26, 2016

Fixed Conflicts/Refactored/Fixed bugs on a commit from @pakrym:
https://github.com/dotnet/cli/issues/3839
https://github.com/dotnet/cli/issues/3840

Added Tests for https://github.com/dotnet/cli/issues/3839

Last commit fixes https://github.com/dotnet/cli/issues/3841
GetTypeBuildExclusion list optimized by enforcing a single visit of each node in the dependency graph, using an iterative rather than recursive graph walk, and replacing the set difference operations with a graph subset search.

Performance increased by .4s on my macbook.
Also optimized GetPlatformExclusionList graph walk by enforcing single node visit.

Performance Data OLD:

Performance Summary:
[100.00% 2.392s] Thread 1
  [99.97% 99.97% 2.392s] Program:Main
    [00.28% 00.28% 0.006s] Program:ConfigureDotNetForFirstTimeUse
    [09.62% 09.62% 0.230s] Program:ResolveRootContexts
      [03.27% 33.99% 0.078s] Program:Loading project.json /Users/brthor/code/test/new/project.json
      [06.28% 65.22% 0.150s] Program:Waiting for project contexts to finish loading
    [00.13% 00.13% 0.003s] Program:Collect graph
    [88.87% 88.90% 2.126s] ProjectBuilder:Build new
      [01.43% 01.61% 0.034s] ProjectBuilder:HasSourceFiles new
      [02.21% 02.48% 0.052s] ProjectBuilder:NeedsRebuilding new
      [81.96% 92.22% 1.961s] ProjectBuilder:RunCompile new
        [19.86% 24.23% 0.475s] ProjectModelPlatformExtensions:GetTypeBuildExclusionList
          [19.84% 99.90% 0.474s] ProjectModelPlatformExtensions:GetTypeBuildExclusionList-marknonbuild
        [47.61% 58.09% 1.139s] Command:Execute dotnet /Users/brthor/code/cli/artifacts/osx.10.11-x64/stage2/sdk/1.0.0-featantares-003217/csc.dll -noconfig @/Users/brthor/code/test/new/obj/Debug/netcoreapp1.0/dotnet-compile-csc.rsp
      [01.51% 01.69% 0.036s] ProjectModelPlatformExtensions:platform exclusion

NEW

Performance Summary:
[100.00% 1.891s] Thread 1
  [99.85% 99.85% 1.888s] Program:Main
    [00.40% 00.40% 0.007s] Program:ConfigureDotNetForFirstTimeUse
    [11.20% 11.22% 0.211s] Program:ResolveRootContexts
      [03.78% 33.78% 0.071s] Program:Loading project.json /Users/brthor/code/test/new/project.json
      [07.33% 65.47% 0.138s] Program:Waiting for project contexts to finish loading
    [00.15% 00.15% 0.002s] Program:Collect graph
    [86.56% 86.69% 1.637s] ProjectBuilder:Build new
      [01.81% 02.09% 0.034s] ProjectBuilder:HasSourceFiles new
      [03.07% 03.54% 0.057s] ProjectBuilder:NeedsRebuilding new
      [79.10% 91.38% 1.495s] ProjectBuilder:RunCompile new
        [60.08% 75.96% 1.136s] Command:Execute dotnet /Users/brthor/code/cli/artifacts/osx.10.11-x64/stage2/sdk/1.0.0-featantares-003217/csc.dll -noconfig @/Users/brthor/code/test/new/obj/Debug/netcoreapp1.0/dotnet-compile-csc.rsp

/cc @pakrym @anurse @eerhardt @piotrpMSFT

pakrym and others added 3 commits July 25, 2016 17:55
@@ -12,6 +12,8 @@ namespace Microsoft.DotNet.ProjectModel.Files
{
public class PatternGroup
{
private static readonly Dictionary<string, IEnumerable<string>> s_resolvedFilesCache = new Dictionary<string, IEnumerable<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.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@brthor
Copy link
Author

brthor commented Jul 26, 2016

test RHEL7.2 x64 Release Build

@@ -28,7 +29,8 @@ private static void CollectDependencies(IDictionary<string, LibraryExport> expor
foreach (var dependency in dependencies)
{
var export = exports[dependency.Name];
if (export.Library.Identity.Version.Equals(dependency.VersionRange.MinVersion))
if (export.Library.Identity.Version.Equals(dependency.VersionRange.MinVersion)
&& !exclusionList.Contains(dependency.Name))

This comment was marked as spam.

This comment was marked as spam.

@brthor
Copy link
Author

brthor commented Aug 2, 2016

Running into issues with Binding Redirects here.

The LibraryExporter cannot simply cache exported projects because the exports of a project change after it is built. Binding redirects being included in the runtime assets of that exported project is conditional on the binding redirect file existing. When the exports are cached the file doesn't exist. Post-build and pre-publish the file does exist, but the cached implementation causes it not to be copied to publish output.

Put up a fix that side steps caching project exports, please take a look.

@brthor
Copy link
Author

brthor commented Aug 2, 2016

The changes to enable caching exports in the libraryexporter was a little more intrusive than we first thought.

Please review @pakrym @anurse

@livarcocc
Copy link

@brthor we are not taking this right? Should we just close it?

@brthor
Copy link
Author

brthor commented Sep 7, 2016

We are taking the graph walk fixes that I made:
dotnet/sdk#41
Closing this out though.

@brthor brthor closed this Sep 7, 2016
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