简体   繁体   English

用于json数据的IIS gzip压缩-我们如何解释有无压缩结果

[英]IIS gzip compression for json data- how do we interpret with and without compression results

Average network timings on chrome i executed emulating chrome's regular 3G network: 我在chrome上平均网络时间是模仿chrome的常规3G网络执行的:

gzip gzip

  • Time (in ms): 1376.8 时间(以毫秒为单位):1376.8
  • Latency (in ms): 1155.777778 延迟(以毫秒为单位):1155.777778
  • Data Receive Time (in ms): 277.1111111 数据接收时间(以毫秒为单位):277.1111111

Non compressed 非压缩

  • Time (in ms): 2220 时间(以毫秒为单位):2220
  • Latency (in ms): 1043.4 延迟(以毫秒为单位):1043.4
  • Data Receive Time (in ms): 1176.6 数据接收时间(以毫秒为单位):1176.6

I have calculated "Data Receive Time" as difference between Time and Latency because as per their definitions: Time is total duration, from the start of the request to the receipt of the final byte in the response. 我已经将“数据接收时间”计算为时间和延迟之间的差异,因为根据它们的定义:时间是从请求开始到响应中最后一个字节接收的总持续时间。 Latency is the time to load the first byte in the response. 延迟是在响应中加载第一个字节的时间。

I have few things that are not clear: 我有几件不清楚的事情:

  • Latency is less for non-compressed, almost by 10%. 非压缩的延迟较小,几乎减少了10%。 I see that because IIS would take some time in compressing in data that might have increased it. 我看到这是因为IIS在压缩可能会增加它的数据上需要花费一些时间。 Opinion? 意见?
  • What i don't understand is how using gzip the "Data Receive Time" is less? 我不明白的是,使用gzip如何缩短“数据接收时间”?

I was assuming since client would receive compressed data, Un-Compress it and then render it. 我假设由于客户端将接收压缩数据,请先将其解压缩然后再呈现。 So this should have taken more time. 因此,这应该花费更多时间。

Without compression browser had to just receive data and render that. 没有压缩,浏览器只能接收数据并进行渲染。

So with compression we have one extra step of uncompressing and still time is lower. 因此,通过压缩,我们还有一个额外的解压缩步骤,而时间却更少。 Anyone has explanation for this? 有人对此有解释吗?

I'm not sure I understand the quandary. 我不确定我是否理解这个难题。 Latency in this discussion is essentially response time; 讨论中的延迟本质上是响应时间。 Client asked for some data, and x amount of time transpired until the first byte of the response was received. 客户端要求提供一些数据,直到收到响应的第一个字节之前,x的时间耗费了时间。 Thus, it can be thought of as an amalgamation of server process time plus network latency. 因此,可以将其视为服务器处理时间加上网络延迟的组合。

Data receive time can be thought of as network latency distributed across every packet of the response. 数据接收时间可以认为是网络延迟分布在响应的每个数据包之间。 The compressed data requires fewer network packets to transfer, which not only reduces the time to transfer because of sheer size reduction, it also reduces the effect of latency per packet because fewer packets transferred = less impact from latency overall. 压缩后的数据需要较少的网络数据包进行传输,这不仅因为减少了大小而减少了传输时间,而且还减少了每个数据包的延迟影响,因为传输的数据包较少=总体延迟影响较小。

So what is surprising here? 那么,这里有什么令人惊讶的呢? Less data takes less time to transfer. 更少的数据花费更少的时间来传输。 The cost of decompressing that data in terms of CPU cycles is vastly lower than the amount of latency in just about any connection. 就CPU周期而言,对数据进行解压缩的成本大大低于几乎所有连接中的等待时间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM