-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Slow performance using dotnet restore & build with deep folder structure #7725
Comments
@vlesierse what does |
Exactly. It's like Think that Edit: It does. If you add more packages to npm the performance will degrade. Previous versions of the SDK with project.json didn't had this problem... |
@rohit21agrawal @emgarten FYI. |
@vlesierse is the react app adding anything that would be handled by MSBuild? Does removing the deep sub folder improve performance? |
It's a set of around 1000 npm dependencies. As of npm 3 the node_modules is flat but still contains 1000 folders. When I remove the node_modules folder the dotnet commands are fast again. I've scanned to MSBuild specific files in the sub folder but there are none. js files and some compiled libraries. The screenshot shows the CPU is piking during the restore and it takes about a minute before it even starts downloading. My guess is it searches for files in the directory structure which isn't that efficient... |
@vlesierse thanks for the info, do you see the same slow behavior when running other targets such as |
Yes, clean has the same behaviour... |
Looks like msbuild is taking long to expand the globs brought in via the web sdk. The targets themselves don't take very long to run (note that I never ran restore or build, just clean):
If I add |
@dasMulli I can confirm that |
@rainersigwald @srivatsn, looks like this should go to msbuild or SDK. Which repo is the winner? |
Assuming you only want to publish the built output and not all development folders, you can exclude folders from being published - including the |
Works great as work around... |
I don't think there's a great general-purpose solution for this. Adding to the default excludes or opting into explicit includes of narrower patterns (which I always recommend anyway, but isn't the default) allows you to specialize to suit your particular case. One possibility would be for the Web Sdk to add (nice debugging @dasMulli!) |
For web applications it's a save assumption to exclude the node_modules by default. If needed you can include specific targets inside the folders, but I think that is very unlikely. |
I'm surprised we don't already do this. |
I think it comes down to weighing
|
I have a Vue app at Adding |
Looks like this has been fixed in the web sdk for the upcoming release https://github.com/aspnet/websdk/blob/dev/src/ProjectSystem/Microsoft.NET.Sdk.Web.ProjectSystem.Targets/netstandard1.0/Microsoft.NET.Sdk.Web.ProjectSystem.props#L15 |
Closing this for now, since it has fixed. If someone still runs into any issues, please, re-activate. |
Steps to reproduce
Create a new .NET Core project
Create an embedded client app using
create-react-app
Restore the .NET Core application
Expected behavior
The expectation is that the restore should be very fast or at least as fast with the project.json version of the sdk.
Actual behavior
Restoring the application's packages is terribly slow, probably due to the deep directory structure which node creates.
Environment data
dotnet --info
output:.NET Command Line Tools (1.0.0-rc4-004771)
Product Information:
Version: 1.0.0-rc4-004771
Commit SHA-1 hash: 4228198
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.12
OS Platform: Darwin
RID: osx.10.12-x64
Base Path: /usr/local/share/dotnet/sdk/1.0.0-rc4-004771
The text was updated successfully, but these errors were encountered: