aspnet / JavaScriptServices

[Archived] This repository has been archived
Apache License 2.0
3.04k stars 519 forks source link

Painfully slow server performance on .NET Core 1.0.0 #151

Closed empz closed 8 years ago

empz commented 8 years ago

I'm having an extremely slow server performance all of a sudden.

In order to test it wasn't anything I added to the template, I've created an empty React/Redux application from the yeoman generator and modified package.json to use the newly .NET Core 1.0.0 packages as following:

{
  "dependencies": {
    "Microsoft.NETCore.App": {
      "version": "1.0.0",
      "type": "platform"
    },
    "Microsoft.AspNetCore.Diagnostics": "1.0.0",
    "Microsoft.AspNetCore.Mvc": "1.0.0",
    "Microsoft.AspNetCore.Razor.Tools": {
      "version": "1.0.0-preview1-final",
      "type": "build"
    },
    "Microsoft.AspNetCore.ReactServices": "1.0.0-*",
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
    "Microsoft.AspNetCore.StaticFiles": "1.0.0",
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
    "Microsoft.Extensions.Configuration.Json": "1.0.0",
    "Microsoft.Extensions.Logging": "1.0.0",
    "Microsoft.Extensions.Logging.Console": "1.0.0",
    "Microsoft.Extensions.Logging.Debug": "1.0.0"
  },

  "tools": {
    "Microsoft.AspNetCore.Razor.Tools": {
      "version": "1.0.0-preview1-final",
      "imports": "portable-net45+win8+dnxcore50"
    },
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": {
      "version": "1.0.0-preview2-final"
    }
  },
  // rest of project.json
}

Then running the project in development mode results in huge load times of assets: image

info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://localhost:5000/
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1]
      Executing action method AspnetcoreSpa.Controllers.HomeController.Index (aspnetcore-spa) with arguments () - ModelState is Valid
info: Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.ViewResultExecutor[1]
      Executing ViewResult, running view at path /Views/Home/Index.cshtml.
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2]
      Executed action AspnetcoreSpa.Controllers.HomeController.Index (aspnetcore-spa) in 3637.6857ms
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 3642.5351ms 200 text/html; charset=utf-8
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://localhost:5000/dist/main.js?v=6ZYWO9abDsbS5XJslj81MbyRPyrDaTQq9MpyEwgW3fQ
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://localhost:5000/dist/vendor.js?v=BH772UWWJoCyeGM9-pZo_Fy6c6FOXG7K6vaVvPPC7cg
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://localhost:5000/dist/vendor.css?v=WkDR4QmPsmL8e0G1mrsXi7xUVZAD5VjImuuRyjPg2KQ
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://localhost:5000/dist/site.css?v=cSV83nJuUJ1OdTRQnj_lYGuqHtCa3BmcL8mwRweYFJI
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 2579.2843ms 200 application/javascript
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
      Sending file. Request path: '/dist/vendor.js'. Physical path: 'E:\Desktop\aspnetcore-spa\wwwroot\dist\vendor.js'
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 5545.0118ms 200 application/javascript
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
      Sending file. Request path: '/dist/vendor.css'. Physical path: 'E:\Desktop\aspnetcore-spa\wwwroot\dist\vendor.css'
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 7684.0947ms 200 text/css
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 10233.8428ms 200 text/css
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://localhost:5000/dist/bootstrap.css.map
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://localhost:5000/__webpack_hmr
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 0.4131ms 302
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://localhost:5000/favicon.ico
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
      Sending file. Request path: '/favicon.ico'. Physical path: 'E:\Desktop\aspnetcore-spa\wwwroot\favicon.ico'
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 1.8288ms 200 image/x-icon
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 2554.541ms 404
empz commented 8 years ago

Running it with ASPNETCORE_ENVIRONMENT=Production results in normal performance: image

empz commented 8 years ago

Nevermind, it's working fast now. Might have been my computer.