New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nuget IKVM slow install on large project #3428

Closed
WimBoom opened this Issue Sep 10, 2016 · 8 comments

Comments

Projects
None yet
6 participants
@WimBoom

WimBoom commented Sep 10, 2016

When we install the Nuget Package IKVM with the package manager console command: Install-Package IKVM (https://www.nuget.org/packages/IKVM). The Executing nuget actions took +/- 40 seconds
could this be improved?

Test Environment:

  • Windows 10 Enterprise
  • VS 2015 VSIX (v3.5.0-rc1), Package Manager Console Host Version 3.5.0.1737
  • Visual Studio 2015 Enterprise with update 3
  • Samsung 850 Pro SSD
  • Intel I7-2670QM (6M Cache, up to 3.10 GHz, Quad Core)
  • No GIT or other source control bindings
  • Internet speed 50 Mbit/sec
  • Sample project:
    WebApplication4.zip

Reproduce steps

  • Open attached project
  • Build project
  • Open Package Manager Console
  • Run command Install-Package IKVM
  • Output Package Manager Console:
Attempting to gather dependency information for package 'IKVM.8.1.5717' with respect to project 'WebApplication4', targeting '.NETFramework,Version=v4.5.2'
Gathering dependency information took 124,88 ms
Attempting to resolve dependencies for package 'IKVM.8.1.5717' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'IKVM.8.1.5717'
Resolved actions to install package 'IKVM.8.1.5717'
Retrieving package 'IKVM 8.1.5717' from 'nuget.org'.
Adding package 'IKVM.8.1.5717' to folder 'c:\users\wim\documents\visual studio 2015\Projects\WebApplication4\packages'
Added package 'IKVM.8.1.5717' to folder 'c:\users\wim\documents\visual studio 2015\Projects\WebApplication4\packages'
Added package 'IKVM.8.1.5717' to 'packages.config'
Successfully installed 'IKVM 8.1.5717' to WebApplication4

Executing nuget actions took 37,53 sec
Time Elapsed: 00:00:38.1169149

On a clean MVC web application solution, the executing nuget actions took +/- 10 seconds...

Attempting to gather dependency information for package 'IKVM.8.1.5717' with respect to project

'WebApplication2', targeting '.NETFramework,Version=v4.5.2'
Gathering dependency information took 84,25 ms
Attempting to resolve dependencies for package 'IKVM.8.1.5717' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'IKVM.8.1.5717'
Resolved actions to install package 'IKVM.8.1.5717'
Retrieving package 'IKVM 8.1.5717' from 'nuget.org'.
Adding package 'IKVM.8.1.5717' to folder 'C:\Temp\WebApplication2\packages'
Added package 'IKVM.8.1.5717' to folder 'C:\Temp\WebApplication2\packages'
Added package 'IKVM.8.1.5717' to 'packages.config'
Successfully installed 'IKVM 8.1.5717' to WebApplication2

Executing nuget actions took 11,48 sec
Time Elapsed: 00:00:12.6800967

@emgarten

This comment has been minimized.

Show comment
Hide comment
@emgarten

emgarten Sep 10, 2016

Contributor

How long does Update-Package -reinstall take? Was the package being downloaded from nuget.org each time or was it in the cache?

There should be little difference in installs times for a class library vs MVC.

Contributor

emgarten commented Sep 10, 2016

How long does Update-Package -reinstall take? Was the package being downloaded from nuget.org each time or was it in the cache?

There should be little difference in installs times for a class library vs MVC.

@WimBoom

This comment has been minimized.

Show comment
Hide comment
@WimBoom

WimBoom Sep 12, 2016

The Sample project:
WebApplication4.zip is MVC.
The package is in cache, the Update-Package IKVM -reinstall (on a another pc, first installed/uninstalled/installed/reinstall)

Test Environment:

Windows 10 Enterprise
VS 2015 VSIX (v3.5.0-rc1), Package Manager Console Host Version 3.5.0.1737
Visual Studio 2015 Enterprise with update 3
Samsung 840 Pro SSD
Intel i7-6820HK Processor (8M Cache, up to 3.60 GHz) 6th generation

Result:

PM> Update-Package IKVM -reinstall
Attempting to gather dependency information for multiple packages with respect to project 'WebApplication4', targeting '.NETFramework,Version=v4.5.2'
Gathering dependency information took 540.53 ms
Attempting to resolve dependencies for multiple packages.
Resolving dependency information took 0 ms
Resolving actions install multiple packages
Retrieving package 'IKVM 8.1.5717' from 'nuget.org'.
Removed package 'IKVM 8.1.5717.0' from 'packages.config'
Successfully uninstalled 'IKVM 8.1.5717.0' from WebApplication4
Package 'IKVM.8.1.5717' already exists in folder 'C:\Users\wim\Desktop\packages'
Added package 'IKVM.8.1.5717' to 'packages.config'
Successfully installed 'IKVM 8.1.5717' to WebApplication4

Executing nuget actions took 29.97 sec
Time Elapsed: 00:00:30.6095238

Test Environment:

Windows 10 Enterprise
VS 2015 VSIX (v3.5.0-rc1), Package Manager Console Host Version 3.5.0.1737
Visual Studio 2015 Enterprise with update 3
Samsung 850 Pro SSD
Intel I7-2670QM (6M Cache, up to 3.10 GHz, Quad Core) 2th generation

Result:

Attempting to gather dependency information for multiple packages with respect to project 'WebApplication4', targeting '.NETFramework,Version=v4.5.2'
Gathering dependency information took 479,49 ms
Attempting to resolve dependencies for multiple packages.
Resolving dependency information took 0 ms
Resolving actions install multiple packages
Retrieving package 'IKVM 8.1.5717' from 'nuget.org'.
Removed package 'IKVM 8.1.5717.0' from 'packages.config'
Successfully uninstalled 'IKVM 8.1.5717.0' from WebApplication4
Package 'IKVM.8.1.5717' already exists in folder 'C:\Users\wim\Documents\Visual Studio 2015\Projects\WebApplication4\packages'
Added package 'IKVM.8.1.5717' to 'packages.config'
Successfully installed 'IKVM 8.1.5717' to WebApplication4

Executing nuget actions took 39,95 sec
Time Elapsed: 00:00:40.5196027

WimBoom commented Sep 12, 2016

The Sample project:
WebApplication4.zip is MVC.
The package is in cache, the Update-Package IKVM -reinstall (on a another pc, first installed/uninstalled/installed/reinstall)

Test Environment:

Windows 10 Enterprise
VS 2015 VSIX (v3.5.0-rc1), Package Manager Console Host Version 3.5.0.1737
Visual Studio 2015 Enterprise with update 3
Samsung 840 Pro SSD
Intel i7-6820HK Processor (8M Cache, up to 3.60 GHz) 6th generation

Result:

PM> Update-Package IKVM -reinstall
Attempting to gather dependency information for multiple packages with respect to project 'WebApplication4', targeting '.NETFramework,Version=v4.5.2'
Gathering dependency information took 540.53 ms
Attempting to resolve dependencies for multiple packages.
Resolving dependency information took 0 ms
Resolving actions install multiple packages
Retrieving package 'IKVM 8.1.5717' from 'nuget.org'.
Removed package 'IKVM 8.1.5717.0' from 'packages.config'
Successfully uninstalled 'IKVM 8.1.5717.0' from WebApplication4
Package 'IKVM.8.1.5717' already exists in folder 'C:\Users\wim\Desktop\packages'
Added package 'IKVM.8.1.5717' to 'packages.config'
Successfully installed 'IKVM 8.1.5717' to WebApplication4

Executing nuget actions took 29.97 sec
Time Elapsed: 00:00:30.6095238

Test Environment:

Windows 10 Enterprise
VS 2015 VSIX (v3.5.0-rc1), Package Manager Console Host Version 3.5.0.1737
Visual Studio 2015 Enterprise with update 3
Samsung 850 Pro SSD
Intel I7-2670QM (6M Cache, up to 3.10 GHz, Quad Core) 2th generation

Result:

Attempting to gather dependency information for multiple packages with respect to project 'WebApplication4', targeting '.NETFramework,Version=v4.5.2'
Gathering dependency information took 479,49 ms
Attempting to resolve dependencies for multiple packages.
Resolving dependency information took 0 ms
Resolving actions install multiple packages
Retrieving package 'IKVM 8.1.5717' from 'nuget.org'.
Removed package 'IKVM 8.1.5717.0' from 'packages.config'
Successfully uninstalled 'IKVM 8.1.5717.0' from WebApplication4
Package 'IKVM.8.1.5717' already exists in folder 'C:\Users\wim\Documents\Visual Studio 2015\Projects\WebApplication4\packages'
Added package 'IKVM.8.1.5717' to 'packages.config'
Successfully installed 'IKVM 8.1.5717' to WebApplication4

Executing nuget actions took 39,95 sec
Time Elapsed: 00:00:40.5196027

@emgarten

This comment has been minimized.

Show comment
Hide comment
@emgarten

emgarten Sep 12, 2016

Contributor

@WimBoom very helpful, thanks for the numbers 😄

Contributor

emgarten commented Sep 12, 2016

@WimBoom very helpful, thanks for the numbers 😄

@WimBoom

This comment has been minimized.

Show comment
Hide comment
@WimBoom

WimBoom Sep 12, 2016

@emgarten :-) I have added the first test environment results with command Update-Package IKVM -reinstall

WimBoom commented Sep 12, 2016

@emgarten :-) I have added the first test environment results with command Update-Package IKVM -reinstall

@rrelyea rrelyea added this to the 3.6 Beta2 milestone Sep 12, 2016

@yishaigalatzer

This comment has been minimized.

Show comment
Hide comment
@yishaigalatzer

yishaigalatzer Sep 14, 2016

I'm not familiar with this package, but looking in it, it seems badly malformed designed/malformed.

  1. It includes many dlls in the lib folder without any target framework. So it pretends to install everywhere, which obviously doesn't actually work.
  2. I'm wondering if there is an actual need to have direct references to all the dlls in this package. It goes against the basic one dll/package pattern we recommend, and in turn visual studio will call add reference multiple time, that will then trigger things like Resharper and other listeners to start acting on reference change events. I believe @jainaashish removed the support for batching in this case (which we should bring back in 3.6 at a minimum if not in 3.5).

Moving back to 3.5 RTM for retriaging.

yishaigalatzer commented Sep 14, 2016

I'm not familiar with this package, but looking in it, it seems badly malformed designed/malformed.

  1. It includes many dlls in the lib folder without any target framework. So it pretends to install everywhere, which obviously doesn't actually work.
  2. I'm wondering if there is an actual need to have direct references to all the dlls in this package. It goes against the basic one dll/package pattern we recommend, and in turn visual studio will call add reference multiple time, that will then trigger things like Resharper and other listeners to start acting on reference change events. I believe @jainaashish removed the support for batching in this case (which we should bring back in 3.6 at a minimum if not in 3.5).

Moving back to 3.5 RTM for retriaging.

@yishaigalatzer yishaigalatzer modified the milestones: 3.5 RTM, 3.6 Beta2 Sep 14, 2016

@WimBoom

This comment has been minimized.

Show comment
Hide comment
@WimBoom

WimBoom Sep 15, 2016

With IKVM package we have been able to integrate our Umbraco application with the Tika text extraction library implemented in Java (http://tika.apache.org/0.7/formats.html). With Tika we can easily pull text out of rich documents from many supported formats. We can do a research with the IKVM assemblies which do not appear to be used, and bring our own nuget package.

On the other hand we use serveral NuGet packages with more than one dll in lib folder, with other packages we have also some performance problems, i think it is related to te number of dll's in the lib folder nuget package. In my environment the Resharper tool is not installed.

WimBoom commented Sep 15, 2016

With IKVM package we have been able to integrate our Umbraco application with the Tika text extraction library implemented in Java (http://tika.apache.org/0.7/formats.html). With Tika we can easily pull text out of rich documents from many supported formats. We can do a research with the IKVM assemblies which do not appear to be used, and bring our own nuget package.

On the other hand we use serveral NuGet packages with more than one dll in lib folder, with other packages we have also some performance problems, i think it is related to te number of dll's in the lib folder nuget package. In my environment the Resharper tool is not installed.

@yishaigalatzer

This comment has been minimized.

Show comment
Hide comment
@yishaigalatzer

yishaigalatzer Sep 15, 2016

Yes that's what I'm seeing as well. Dlls in the lib folder are meant to be added as references. Adding a reference is a relatively expensive operation in Visual Studio and there are many listeners to reference changed events.

We do have a batching API that we should call to reduce some of the cost, but many dlls and particularly ones that do not need to actually be used as reference is going to make things a lot slower.

We should look at:

  1. Can we bring back batching for this scenario and improve it.
  2. Do some of these dlls don't even work as references, and hence the package should be modified.
  3. Are there other cost factors that makes adding this so slow.

yishaigalatzer commented Sep 15, 2016

Yes that's what I'm seeing as well. Dlls in the lib folder are meant to be added as references. Adding a reference is a relatively expensive operation in Visual Studio and there are many listeners to reference changed events.

We do have a batching API that we should call to reduce some of the cost, but many dlls and particularly ones that do not need to actually be used as reference is going to make things a lot slower.

We should look at:

  1. Can we bring back batching for this scenario and improve it.
  2. Do some of these dlls don't even work as references, and hence the package should be modified.
  3. Are there other cost factors that makes adding this so slow.
@dtivel

This comment has been minimized.

Show comment
Hide comment
@dtivel

dtivel Sep 27, 2016

Contributor

Ported fix to 3.5 RTM branch via commit 964fe41760395a44d7adf29f9f896524ccb72025.

Contributor

dtivel commented Sep 27, 2016

Ported fix to 3.5 RTM branch via commit 964fe41760395a44d7adf29f9f896524ccb72025.

@dtivel dtivel closed this Sep 27, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment