0

I am looking at a ASP MVC Web APP whose rendering seems to be very slow. I converted a html template into an ASP MVC app, creating the _layouts etc.

After looking at some article on SO, I found to improve performance this, and I did the following, it helped a little.

    ViewEngines.Engines.Clear();    
    ViewEngines.Engines.Add(new RazorViewEngine()); 

Question: How to detect nested, or redundant calls in ASP MVC rendering from Visual Studio, Chromer or whatever. Should I user glimpse or this MiniProfiler, which seems 7 yrs old

I want to identify

  1. what libs are contenders for the delay/optimization
  2. If there are dual calls to any loading of CSS or JS files
  3. re-organization of scripts/styles, as a general rule, can I add all JS scripts at the bottom of the _Layout and all styles at the head page (in the right order of-course)

thanks

Community
  • 1
  • 1
Transformer
  • 6,963
  • 2
  • 26
  • 52
  • What do you mean `nested or redundant calls` here? You can use bundling (with `Microsoft.AspNet.Optimization` package) to optimize style and script renderings. – Tetsuya Yamamoto Jan 31 '17 at 04:05
  • Hi, I am using bundling for mostly everything, but for individual pages ~(30) where the libs are only used on that page I am loading without bundling directly or in the case of a CDN for local dev. My issue is how to trouble shoot, and view what is causing the delay in the load of the pages – Transformer Jan 31 '17 at 04:50
  • AFAIK, MVC bundling system can be configured to contain library files which only used for certain pages with different namings (just ensure to use right bundle with right page). You can use `@RenderSection` and `@Styles/Scripts.Render` to differentiate rendered styles/scripts in certain page and inspect which one causing delay on load. – Tetsuya Yamamoto Jan 31 '17 at 05:03
  • @TetsuyaYamamoto I am doing that already, but I want to see why my page is loading so slow... and look at if there are repeat calls or mistakes in the way I have configured my layout files – Transformer Jan 31 '17 at 05:25
  • 1
    Probably you should look into "Network" tab in browser console first, load any pages with slow loading problem when the tab is being open. It will tell you how many requests, size of each request and time to solve them to be considered next. – Tetsuya Yamamoto Jan 31 '17 at 05:45
  • man that helped, showed me that it was not finding somefiles – Transformer Jan 31 '17 at 06:31
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/134445/discussion-between-tetsuya-yamamoto-and-transformer). – Tetsuya Yamamoto Jan 31 '17 at 06:35
  • ok I can meet you on chat, I found something similar here... but no answers on [StackOverflow](http://stackoverflow.com/a/8507100/6085193) – Transformer Jan 31 '17 at 07:50

0 Answers0