flyzy博客
分享便宜VPS与网络优惠
搬瓦工

PHP压缩函数研究

单独一行的那个是原始长度
下面是4个函数压缩级别从0到9的压缩后长度
可以看出不同的函数和不同的压缩级别,差别不是很大。
总体来说,gzdeflate +9级,以微弱优势胜出。

还有别的压缩姿势吗?
2514 gzdeflate – 0:2519 1:1680 2:1672 3:1668 4:1658 5:1657 6:1657 7:1657 8:1657 9:1657 gzcompress – 0:2525 1:1686 2:1678 3:1674 4:1664 5:1663 6:1663 7:1663 8:1663 9:1663 gzencode – 0:2537 1:1698 2:1690 3:1686 4:1676 5:1675 6:1675 7:1675 8:1675 9:1675 bzcompress – 0:2 1:1728 2:1728 3:1728 4:1728 5:1728 6:1728 7:1728 8:1728 9:1728 2753 gzdeflate – 0:2758 1:1793 2:1783 3:1779 4:1771 5:1771 6:1771 7:1771 8:1771 9:1771 gzcompress – 0:2764 1:1799 2:1789 3:1785 4:1777 5:1777 6:1777 7:1777 8:1777 9:1777 gzencode – 0:2776 1:1811 2:1801 3:1797 4:1789 5:1789 6:1789 7:1789 8:1789 9:1789 bzcompress – 0:2 1:1873 2:1873 3:1873 4:1873 5:1873 6:1873 7:1873 8:1873 9:1873 155 gzdeflate – 0:160 1:139 2:139 3:139 4:139 5:139 6:139 7:139 8:139 9:139 gzcompress – 0:166 1:145 2:145 3:145 4:145 5:145 6:145 7:145 8:145 9:145 gzencode – 0:178 1:157 2:157 3:157 4:157 5:157 6:157 7:157 8:157 9:157 bzcompress – 0:2 1:178 2:178 3:178 4:178 5:178 6:178 7:178 8:178 9:178 286 gzdeflate – 0:291 1:262 2:262 3:262 4:262 5:262 6:262 7:262 8:262 9:262 gzcompress – 0:297 1:268 2:268 3:268 4:268 5:268 6:268 7:268 8:268 9:268 gzencode – 0:309 1:280 2:280 3:280 4:280 5:280 6:280 7:280 8:280 9:280 bzcompress – 0:2 1:319 2:319 3:319 4:319 5:319 6:319 7:319 8:319 9:319 1498 gzdeflate – 0:1503 1:854 2:844 3:841 4:820 5:819 6:819 7:819 8:819 9:819 gzcompress – 0:1509 1:860 2:850 3:847 4:826 5:825 6:825 7:825 8:825 9:825 gzencode – 0:1521 1:872 2:862 3:859 4:838 5:837 6:837 7:837 8:837 9:837 bzcompress – 0:2 1:941 2:941 3:941 4:941 5:941 6:941 7:941 8:941 9:941 314 gzdeflate – 0:319 1:271 2:271 3:271 4:271 5:271 6:271 7:271 8:271 9:271 gzcompress – 0:325 1:277 2:277 3:277 4:277 5:277 6:277 7:277 8:277 9:277 gzencode – 0:337 1:289 2:289 3:289 4:289 5:289 6:289 7:289 8:289 9:289 bzcompress – 0:2 1:336 2:336 3:336 4:336 5:336 6:336 7:336 8:336 9:336 4177 gzdeflate – 0:4182 1:2853 2:2847 3:2841 4:2821 5:2818 6:2818 7:2818 8:2818 9:2818 gzcompress – 0:4188 1:2859 2:2853 3:2847 4:2827 5:2824 6:2824 7:2824 8:2824 9:2824 gzencode – 0:4200 1:2871 2:2865 3:2859 4:2839 5:2836 6:2836 7:2836 8:2836 9:2836 bzcompress – 0:2 1:2857 2:2857 3:2857 4:2857 5:2857 6:2857 7:2857 8:2857 9:2857 874 gzdeflate – 0:879 1:621 2:618 3:617 4:616 5:616 6:616 7:616 8:616 9:616 gzcompress – 0:885 1:627 2:624 3:623 4:622 5:622 6:622 7:622 8:622 9:622 gzencode – 0:897 1:639 2:636 3:635 4:634 5:634 6:634 7:634 8:634 9:634 bzcompress – 0:2 1:715 2:715 3:715 4:715 5:715 6:715 7:715 8:715 9:715 3888 gzdeflate – 0:3893 1:2058 2:2043 3:2039 4:2015 5:2013 6:2013 7:2013 8:2013 9:2013 gzcompress – 0:3899 1:2064 2:2049 3:2045 4:2021 5:2019 6:2019 7:2019 8:2019 9:2019 gzencode – 0:3911 1:2076 2:2061 3:2057 4:2033 5:2031 6:2031 7:2031 8:2031 9:2031 bzcompress – 0:2 1:2128 2:2128 3:2128 4:2128 5:2128 6:2128 7:2128 8:2128 9:2128 2784 gzdeflate – 0:2789 1:1465 2:1463 3:1455 4:1453 5:1446 6:1445 7:1445 8:1445 9:1445 gzcompress – 0:2795 1:1471 2:1469 3:1461 4:1459 5:1452 6:1451 7:1451 8:1451 9:1451 gzencode – 0:2807 1:1483 2:1481 3:1473 4:1471 5:1464 6:1463 7:1463 8:1463 9:1463 bzcompress – 0:2 1:1461 2:1461 3:1461 4:1461 5:1461 6:1461 7:1461 8:1461 9:1461 5484 gzdeflate – 0:5489 1:2467 2:2465 3:2452 4:2445 5:2437 6:2433 7:2427 8:2425 9:2425 gzcompress – 0:5495 1:2473 2:2471 3:2458 4:2451 5:2443 6:2439 7:2433 8:2431 9:2431 gzencode – 0:5507 1:2485 2:2483 3:2470 4:2463 5:2455 6:2451 7:2445 8:2443 9:2443 bzcompress – 0:2 1:2309 2:2309 3:2309 4:2309 5:2309 6:2309 7:2309 8:2309 9:2309 299 gzdeflate – 0:304 1:273 2:273 3:273 4:273 5:273 6:273 7:273 8:273 9:273 gzcompress – 0:310 1:279 2:279 3:279 4:279 5:279 6:279 7:279 8:279 9:279 gzencode – 0:322 1:291 2:291 3:291 4:291 5:291 6:291 7:291 8:291 9:291 bzcompress – 0:2 1:335 2:335 3:335 4:335 5:335 6:335 7:335 8:335 9:335 7803 gzdeflate – 0:7808 1:4723 2:4704 3:4687 4:4607 5:4603 6:4598 7:4598 8:4598 9:4598 gzcompress – 0:7814 1:4729 2:4710 3:4693 4:4613 5:4609 6:4604 7:4604 8:4604 9:4604 gzencode – 0:7826 1:4741 2:4722 3:4705 4:4625 5:4621 6:4616 7:4616 8:4616 9:4616 bzcompress – 0:2 1:4665 2:4665 3:4665 4:4665 5:4665 6:4665 7:4665 8:4665 9:4665 318 gzdeflate – 0:323 1:284 2:284 3:284 4:284 5:284 6:284 7:284 8:284 9:284 gzcompress – 0:329 1:290 2:290 3:290 4:290 5:290 6:290 7:290 8:290 9:290 gzencode – 0:341 1:302 2:302 3:302 4:302 5:302 6:302 7:302 8:302 9:302 bzcompress – 0:2 1:337 2:337 3:337 4:337 5:337 6:337 7:337 8:337 9:337 8701 gzdeflate – 0:8706 1:4555 2:4521 3:4491 4:4447 5:4437 6:4427 7:4423 8:4423 9:4423 gzcompress – 0:8712 1:4561 2:4527 3:4497 4:4453 5:4443 6:4433 7:4429 8:4429 9:4429 gzencode – 0:8724 1:4573 2:4539 3:4509 4:4465 5:4455 6:4445 7:4441 8:4441 9:4441 bzcompress – 0:2 1:4163 2:4163 3:4163 4:4163 5:4163 6:4163 7:4163 8:4163 9:4163 1628 gzdeflate – 0:1633 1:841 2:841 3:840 4:832 5:832 6:832 7:832 8:832 9:832 gzcompress – 0:1639 1:847 2:847 3:846 4:838 5:838 6:838 7:838 8:838 9:838 gzencode – 0:1651 1:859 2:859 3:858 4:850 5:850 6:850 7:850 8:850 9:850 bzcompress – 0:2 1:1025 2:1025 3:1025 4:1025 5:1025 6:1025 7:1025 8:1025 9:1025 6598 gzdeflate – 0:6603 1:3160 2:3113 3:3091 4:3053 5:3033 6:3025 7:3021 8:3020 9:3020 gzcompress – 0:6609 1:3166 2:3119 3:3097 4:3059 5:3039 6:3031 7:3027 8:3026 9:3026 gzencode – 0:6621 1:3178 2:3131 3:3109 4:3071 5:3051 6:3043 7:3039 8:3038 9:3038 bzcompress – 0:2 1:2948 2:2948 3:2948 4:2948 5:2948 6:2948 7:2948 8:2948 9:2948 1767 gzdeflate – 0:1772 1:982 2:977 3:976 4:963 5:963 6:963 7:963 8:963 9:963 gzcompress – 0:1778 1:988 2:983 3:982 4:969 5:969 6:969 7:969 8:969 9:969 gzencode – 0:1790 1:1000 2:995 3:994 4:981 5:981 6:981 7:981 8:981 9:981 bzcompress – 0:2 1:1152 2:1152 3:1152 4:1152 5:1152 6:1152 7:1152 8:1152 9:1152 212 gzdeflate – 0:217 1:175 2:175 3:176 4:176 5:176 6:176 7:176 8:176 9:176 gzcompress – 0:223 1:181 2:181 3:182 4:182 5:182 6:182 7:182 8:182 9:182 gzencode – 0:235 1:193 2:193 3:194 4:194 5:194 6:194 7:194 8:194 9:194 bzcompress – 0:2 1:214 2:214 3:214 4:214 5:214 6:214 7:214 8:214 9:214 1456 gzdeflate – 0:1461 1:1034 2:1034 3:1031 4:1026 5:1024 6:1024 7:1024 8:1024 9:1024 gzcompress – 0:1467 1:1040 2:1040 3:1037 4:1032 5:1030 6:1030 7:1030 8:1030 9:1030 gzencode – 0:1479 1:1052 2:1052 3:1049 4:1044 5:1042 6:1042 7:1042 8:1042 9:1042 bzcompress – 0:2 1:1137 2:1137 3:1137 4:1137 5:1137 6:1137 7:1137 8:1137 9:1137 3711 gzdeflate – 0:3716 1:2021 2:2015 3:2011 4:1991 5:1988 6:1988 7:1988 8:1988 9:1988 gzcompress – 0:3722 1:2027 2:2021 3:2017 4:1997 5:1994 6:1994 7:1994 8:1994 9:1994 gzencode – 0:3734 1:2039 2:2033 3:2029 4:2009 5:2006 6:2006 7:2006 8:2006 9:2006 bzcompress – 0:2 1:2146 2:2146 3:2146 4:2146 5:2146 6:2146 7:2146 8:2146 9:2146 229 gzdeflate – 0:234 1:226 2:226 3:226 4:226 5:226 6:226 7:226 8:226 9:226 gzcompress – 0:240 1:232 2:232 3:232 4:232 5:232 6:232 7:232 8:232 9:232 gzencode – 0:252 1:244 2:244 3:244 4:244 5:244 6:244 7:244 8:244 9:244 bzcompress – 0:2 1:281 2:281 3:281 4:281 5:281 6:281 7:281 8:281 9:281 2837 gzdeflate – 0:2842 1:1529 2:1508 3:1499 4:1486 5:1475 6:1473 7:1470 8:1470 9:1470 gzcompress – 0:2848 1:1535 2:1514 3:1505 4:1492 5:1481 6:1479 7:1476 8:1476 9:1476 gzencode – 0:2860 1:1547 2:1526 3:1517 4:1504 5:1493 6:1491 7:1488 8:1488 9:1488 bzcompress – 0:2 1:1568 2:1568 3:1568 4:1568 5:1568 6:1568 7:1568 8:1568 9:1568 818 gzdeflate – 0:823 1:519 2:519 3:518 4:517 5:516 6:516 7:516 8:516 9:516 gzcompress – 0:829 1:525 2:525 3:524 4:523 5:522 6:522 7:522 8:522 9:522 gzencode – 0:841 1:537 2:537 3:536 4:535 5:534 6:534 7:534 8:534 9:534 bzcompress – 0:2 1:639 2:639 3:639 4:639 5:639 6:639 7:639 8:639 9:639 6131 gzdeflate – 0:6136 1:3798 2:3775 3:3768 4:3740 5:3733 6:3732 7:3732 8:3732 9:3732 gzcompress – 0:6142 1:3804 2:3781 3:3774 4:3746 5:3739 6:3738 7:3738 8:3738 9:3738 gzencode – 0:6154 1:3816 2:3793 3:3786 4:3758 5:3751 6:3750 7:3750 8:3750 9:3750 bzcompress – 0:2 1:3658 2:3658 3:3658 4:3658 5:3658 6:3658 7:3658 8:3658 9:3658 复制代码

江苏省网友说:文本文件的压缩率一般能达到80%到90%

为啥字符串的,只有一半左右

还有啥更NB的姿势吗?

赞(0) 打赏
关注我们
未经允许不得转载:flyzy博客 » PHP压缩函数研究
分享到: 更多 (0)

这是一种鼓励

支付宝扫一扫打赏

微信扫一扫打赏