note 106239 added to function.gzcompress
| From: | Eric at osu1 dot php dot net | Date: | Thu, 20 Oct 2011 17:10:04 +0000 |
| Subject: | note 106239 added to function.gzcompress | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-184032@lists.php.net to get a copy of this message | ||
Did some simple benchmarking of gzcompress() this morning on a lightly-loaded Fedora 12 server with
an AMD Phenom II 940 (quad-core) rocking 8 gigs of ram and executing PHP 5.3.2.2 as an Apache
module:
Compression benchmark: (level, time, size (%)):
0: 0.000373 - 82.08 kB (100.02%)
1: 0.000914 - 19.61 kB (23.90%)
2: 0.000951 - 18.88 kB (23.01%)
3: 0.000999 - 18.43 kB (22.46%)
4: 0.001498 - 17.65 kB (21.51%)
5: 0.001744 - 17.09 kB (20.82%)
6: 0.002060 - 16.88 kB (20.57%)
7: 0.002233 - 16.85 kB (20.53%)
8: 0.002808 - 16.71 kB (20.36%)
9: 0.002928 - 16.71 kB (20.36%)
The time code evaluates to:
1. Get start microtime
2. Call gzcompress
3. Get end microtime
4. Report average duration of 100 cycles
The 82.08 kB was a copied and pasted string of two actual, PHP-generated pages we use on our
intranet. Running some rough calculations, the time it takes to compress the data at level 9 will
never be larger than the time it takes to transmit slightly-less compressed data at levels 6 or
lower. In other words, in our application, we have no reason not to fully-compress each PHP
script's output.
----
Server IP: 69.147.83.197
Probable Submitter: 74.129.203.22
----
Manual Page -- http://www.php.net/manual/en/function.gzcompress.php
Edit -- https://master.php.net/note/edit/106239
Del: integrated -- https://master.php.net/note/delete/106239/integrated
Del: useless -- https://master.php.net/note/delete/106239/useless
Del: bad code -- https://master.php.net/note/delete/106239/bad+code
Del: spam -- https://master.php.net/note/delete/106239/spam
Del: non-english -- https://master.php.net/note/delete/106239/non-english
Del: in docs -- https://master.php.net/note/delete/106239/in+docs
Del: other reasons-- https://master.php.net/note/delete/106239
Reject -- https://master.php.net/note/reject/106239
Search -- https://master.php.net/manage/user-notes.php