Why is http://storyfollower.com slower when I use gzip?
Check the data bellow:
With compression: Load time 1.99s Page size 586.2kB Perf. grade 83/100 Archived: http://tools.pingdom.com/fpt/#!/nE0Jnn7Hp/http://storyfollower.com
Without Compression Load time 835ms Page size 756.2kB Perf. grade 79/100 Archived: http://tools.pingdom.com/fpt/#!/nFmp4l3Ez/storyfollower.com
thanks
The reason is that gzip operates on (in terms of CPU speed vs HD seek speed these days) extremely low buffer sizes. It reads a few KB from from the input file, compresses it, and flushes it to the output file. Given the fact that this requires a hard drive seek, only a few operations can be done per seconds.
You will have a little bit of added programming to do in order to decode the gzip header and perform the integrity check with the gzip trailer. You would then use Inflater with the nowrap option to decompress the raw deflated data after then gzip header and before the trailer.
Gzip Compression is Enabled by Default.
gzip compression adds about 0.001 seconds to compress, and 0.0003 seconds to decompress (let's round up and say 0.002 total), but you only have to transmit 16kB, which takes 0.0032 seconds. Add them together, transfer with gzip compression is about twice as fast.
Most of the overhead is waiting for the server to send data. I guess that is the time needed to compress the data.
Using compression for the page under test gains you very little: 587Kb -> 756Kb, so the CPU overhead is greater than what you gain from sending smaller data.
I'd suggest you try with another page which sends more data. If you don't have such pages, then using compression is probably not the best choice.
A nice way to have both gzip and low cpu overhead is using a cdn and storing the gziped files there
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With