初学者的分析Qn - ASP .NET MVC + Mini-Profiler + Chrome开发者工具

时间:2022-08-10 03:21:28

初学者的分析Qn  -  ASP .NET MVC + Mini-Profiler + Chrome开发者工具

Two sections highlighted above.

上面两个部分突出显示


1st - Mini-Profiler telling me how much time execution of a Controller/Action is taking (called via ajax)

1st - Mini-Profiler告诉我控制器/动作的执行时间(通过ajax调用)

87ms


2nd - Chrome Web Inspector telling me how much time the same ajax request is taking to complete

第二 - Chrome Web Inspector告诉我完成相同的ajax请求需要多长时间

535 ms


Using glimpse, I figured that execution of the other lifecycle events (base controller / filters) took ~22ms.

使用glimpse,我认为执行其他生命周期事件(基本控制器/过滤器)需要大约22ms。

Looking for guidance to figure out where the rest of the time is going.

寻找指导,以找出其余时间的去向。

Thanks.


Edit

This is almost consistent (variance is ~10 - 20 ms in both values - Mini-Profiler's and Chrome Inspector's).

这几乎是一致的(两个值中的差异大约为10 - 20 ms - Mini-Profiler和Chrome Inspector)。

These results are for an online request against a production server (VPS) running IIS 7.5. When these numbers are measured on a dev machine (localhost running IIS express), difference in Mini-Profiler and Chrome Inspector results isn't as significant.

这些结果用于针对运行IIS 7.5的生产服务器(VPS)的联机请求。当这些数字在开发机器(运行IIS express的localhost)上测量时,Mini-Profiler和Chrome Inspector结果的差异并不显着。

1 个解决方案

#1


4  

Since these requests are against an online resource you need to account for the latency.

由于这些请求针对在线资源,因此您需要考虑延迟。

For example take this:

比如拿这个:

初学者的分析Qn  -  ASP .NET MVC + Mini-Profiler + Chrome开发者工具

Server time is merely 118ms, however the dns lookup takes 598ms, connecting takes another 205ms and the response only comes back +1173ms after I visited the page. Finally the DOM only starts rendering 1.27 seconds in.

服务器时间仅为118毫秒,但是dns查找需要598毫秒,连接需要另外205毫秒,响应仅在我访问页面后返回+ 1173毫秒。最后DOM只开始渲染1.27秒。

The server bits only account for time spent on the server inside your app.

服务器位仅考虑应用程序内服务器上花费的时间。

You must add to that.

你必须添加到那个。

  1. Time it takes to resolve dns.
  2. 解决dns所需的时间。

  3. Time it takes to connect (if no keepalive is in place)
  4. 连接所需的时间(如果没有保持连接)

[waiting time]

  1. Time it takes to send the TCP packet asking for the resource
  2. 发送请求资源的TCP数据包所需的时间

  3. Overhead on the web server / proxy front end
  4. Web服务器/代理前端的开销

  5. Server time (the bright red number)
  6. 服务器时间(鲜红色数字)

  7. Time it takes for the first TCP packet to find its way back to you.
  8. 第一个TCP数据包找回给你的时间。

[/waiting time]

  1. Time it takes the rest of the packets to find the way back to you. (read about TCP congestion windows)
  2. 剩下的数据包需要时间来找回给你的方式。 (阅读TCP拥塞窗口)

  3. Time it takes the browser to parse the stuff it gets back
  4. 浏览器解析它返回的东西需要的时间

  5. Time it takes it render
  6. 渲染时间

(and then there is the interdependency of JavaScript and CSS that I am not going to touch on here)

(然后我会在这里讨论JavaScript和CSS的相互依赖性)

#1


4  

Since these requests are against an online resource you need to account for the latency.

由于这些请求针对在线资源,因此您需要考虑延迟。

For example take this:

比如拿这个:

初学者的分析Qn  -  ASP .NET MVC + Mini-Profiler + Chrome开发者工具

Server time is merely 118ms, however the dns lookup takes 598ms, connecting takes another 205ms and the response only comes back +1173ms after I visited the page. Finally the DOM only starts rendering 1.27 seconds in.

服务器时间仅为118毫秒,但是dns查找需要598毫秒,连接需要另外205毫秒,响应仅在我访问页面后返回+ 1173毫秒。最后DOM只开始渲染1.27秒。

The server bits only account for time spent on the server inside your app.

服务器位仅考虑应用程序内服务器上花费的时间。

You must add to that.

你必须添加到那个。

  1. Time it takes to resolve dns.
  2. 解决dns所需的时间。

  3. Time it takes to connect (if no keepalive is in place)
  4. 连接所需的时间(如果没有保持连接)

[waiting time]

  1. Time it takes to send the TCP packet asking for the resource
  2. 发送请求资源的TCP数据包所需的时间

  3. Overhead on the web server / proxy front end
  4. Web服务器/代理前端的开销

  5. Server time (the bright red number)
  6. 服务器时间(鲜红色数字)

  7. Time it takes for the first TCP packet to find its way back to you.
  8. 第一个TCP数据包找回给你的时间。

[/waiting time]

  1. Time it takes the rest of the packets to find the way back to you. (read about TCP congestion windows)
  2. 剩下的数据包需要时间来找回给你的方式。 (阅读TCP拥塞窗口)

  3. Time it takes the browser to parse the stuff it gets back
  4. 浏览器解析它返回的东西需要的时间

  5. Time it takes it render
  6. 渲染时间

(and then there is the interdependency of JavaScript and CSS that I am not going to touch on here)

(然后我会在这里讨论JavaScript和CSS的相互依赖性)