简体   繁体   中英

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:

gzip

  • Time (in ms): 1376.8
  • Latency (in ms): 1155.777778
  • Data Receive Time (in ms): 277.1111111

Non compressed

  • Time (in ms): 2220
  • Latency (in ms): 1043.4
  • Data Receive Time (in ms): 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%. I see that because IIS would take some time in compressing in data that might have increased it. Opinion?
  • What i don't understand is how using gzip the "Data Receive Time" is less?

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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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