🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #87235

About compression ratio

#87235
From: Julien ÉLIE
Date: Mon, 16 Nov 2015 19:07
390 lines
14676 bytes
Hi all,

I've just tested various compression levels for a set of NNTP commands and answers.

In summary:
* 1-line commands and answers have a greater size when compressed;
* the RFC should not recommend level 0 when no compression is desired but level 1;
* for articles having base64 attachments, the compression ratio is 75% so it is still desirable to compress them;
* answers to LIST (of all sorts like ACTIVE, ACTIVE.TIMES, COUNTS, NEWSGROUPS, and even MODERATORS or OVERVIEW.FMT), LISTGROUP, HDR, OVER and NEWNEWS commands are worth compressing.


Here are the numbers:

CAPABILITIES\r\n
----------------

Uncompressed:  14 bytes
Compressed with level 0:  24 bytes (171%)
Compressed with level 1:  20 bytes (142%)
Compressed with level 2:  20 bytes (142%)
Compressed with level 3:  20 bytes (142%)
Compressed with level 4:  20 bytes (142%)
Compressed with level 5:  20 bytes (142%)
Compressed with level 6:  20 bytes (142%)
Compressed with level 7:  20 bytes (142%)
Compressed with level 8:  20 bytes (142%)
Compressed with level 9:  20 bytes (142%)


DATE\r\n
--------

Uncompressed:  6 bytes
Compressed with level 0:  16 bytes (266%)
Compressed with level 1:  12 bytes (200%)
Compressed with level 2:  12 bytes (200%)
Compressed with level 3:  12 bytes (200%)
Compressed with level 4:  12 bytes (200%)
Compressed with level 5:  12 bytes (200%)
Compressed with level 6:  12 bytes (200%)
Compressed with level 7:  12 bytes (200%)
Compressed with level 8:  12 bytes (200%)
Compressed with level 9:  12 bytes (200%)


111 20151116090621\r\n
----------------------

Uncompressed:  20 bytes
Compressed with level 0:  30 bytes (150%)
Compressed with level 1:  26 bytes (130%)
Compressed with level 2:  26 bytes (130%)
Compressed with level 3:  26 bytes (130%)
Compressed with level 4:  26 bytes (130%)
Compressed with level 5:  26 bytes (130%)
Compressed with level 6:  26 bytes (130%)
Compressed with level 7:  26 bytes (130%)
Compressed with level 8:  26 bytes (130%)
Compressed with level 9:  26 bytes (130%)


GROUP news.software.nntp\r\n
----------------------------

Uncompressed:  26 bytes
Compressed with level 0:  36 bytes (138%)
Compressed with level 1:  32 bytes (123%)
Compressed with level 2:  32 bytes (123%)
Compressed with level 3:  32 bytes (123%)
Compressed with level 4:  32 bytes (123%)
Compressed with level 5:  32 bytes (123%)
Compressed with level 6:  32 bytes (123%)
Compressed with level 7:  32 bytes (123%)
Compressed with level 8:  32 bytes (123%)
Compressed with level 9:  32 bytes (123%)


211 8603 1 12856 news.software.nntp\r\n
---------------------------------------

Uncompressed:  37 bytes
Compressed with level 0:  47 bytes (127%)
Compressed with level 1:  43 bytes (116%)
Compressed with level 2:  43 bytes (116%)
Compressed with level 3:  43 bytes (116%)
Compressed with level 4:  43 bytes (116%)
Compressed with level 5:  43 bytes (116%)
Compressed with level 6:  43 bytes (116%)
Compressed with level 7:  43 bytes (116%)
Compressed with level 8:  43 bytes (116%)
Compressed with level 9:  43 bytes (116%)


NEXT\r\n
--------

Uncompressed:  6 bytes
Compressed with level 0:  16 bytes (266%)
Compressed with level 1:  12 bytes (200%)
Compressed with level 2:  12 bytes (200%)
Compressed with level 3:  12 bytes (200%)
Compressed with level 4:  12 bytes (200%)
Compressed with level 5:  12 bytes (200%)
Compressed with level 6:  12 bytes (200%)
Compressed with level 7:  12 bytes (200%)
Compressed with level 8:  12 bytes (200%)
Compressed with level 9:  12 bytes (200%)


223 12856 <AABWSMt+DGcAAEfe.A1.flnews@WStation4.micha.freeshell.org> Article retrieved; request text separately\r\n
-------------------------------------------------------------------------------------------------------------------

Uncompressed:  113 bytes
Compressed with level 0:  123 bytes (108%)
Compressed with level 1:  115 bytes (101%)
Compressed with level 2:  115 bytes (101%)
Compressed with level 3:  115 bytes (101%)
Compressed with level 4:  115 bytes (101%)
Compressed with level 5:  115 bytes (101%)
Compressed with level 6:  115 bytes (101%)
Compressed with level 7:  115 bytes (101%)
Compressed with level 8:  115 bytes (101%)
Compressed with level 9:  115 bytes (101%)


ARTICLE <AABWSMt+DGcAAEfe.A1.flnews@WStation4.micha.freeshell.org>\r\n
----------------------------------------------------------------------

Uncompressed:  68 bytes
Compressed with level 0:  78 bytes (114%)
Compressed with level 1:  74 bytes (108%)
Compressed with level 2:  74 bytes (108%)
Compressed with level 3:  74 bytes (108%)
Compressed with level 4:  74 bytes (108%)
Compressed with level 5:  74 bytes (108%)
Compressed with level 6:  74 bytes (108%)
Compressed with level 7:  74 bytes (108%)
Compressed with level 8:  74 bytes (108%)
Compressed with level 9:  74 bytes (108%)


Processing article-answer
-------------------------

Uncompressed:  2803 bytes
Compressed with level 0:  2813 bytes (100%)
Compressed with level 1:  1591 bytes (56%)
Compressed with level 2:  1587 bytes (56%)
Compressed with level 3:  1586 bytes (56%)
Compressed with level 4:  1564 bytes (55%)
Compressed with level 5:  1562 bytes (55%)
Compressed with level 6:  1562 bytes (55%)
Compressed with level 7:  1562 bytes (55%)
Compressed with level 8:  1562 bytes (55%)
Compressed with level 9:  1562 bytes (55%)


Processing article-base64-attachment-answer
-------------------------------------------

Uncompressed:  13710605 bytes
Compressed with level 0:  13712720 bytes (100%)
Compressed with level 1:  10532602 bytes (76%)
Compressed with level 2:  10530299 bytes (76%)
Compressed with level 3:  10529281 bytes (76%)
Compressed with level 4:  10359065 bytes (75%)
Compressed with level 5:  10358692 bytes (75%)
Compressed with level 6:  10358046 bytes (75%)
Compressed with level 7:  10357747 bytes (75%)
Compressed with level 8:  10357235 bytes (75%)
Compressed with level 9:  10357010 bytes (75%)


Processing capabilities-answer
------------------------------

Uncompressed:  336 bytes
Compressed with level 0:  346 bytes (102%)
Compressed with level 1:  244 bytes (72%)
Compressed with level 2:  244 bytes (72%)
Compressed with level 3:  244 bytes (72%)
Compressed with level 4:  244 bytes (72%)
Compressed with level 5:  244 bytes (72%)
Compressed with level 6:  244 bytes (72%)
Compressed with level 7:  244 bytes (72%)
Compressed with level 8:  244 bytes (72%)
Compressed with level 9:  244 bytes (72%)


Processing hdr-subject-answer-8604-articles
-------------------------------------------

Uncompressed:  429640 bytes
Compressed with level 0:  429715 bytes (100%)
Compressed with level 1:  74666 bytes (17%)
Compressed with level 2:  73811 bytes (17%)
Compressed with level 3:  73865 bytes (17%)
Compressed with level 4:  68546 bytes (15%)
Compressed with level 5:  63964 bytes (14%)
Compressed with level 6:  63603 bytes (14%)
Compressed with level 7:  62960 bytes (14%)
Compressed with level 8:  62469 bytes (14%)
Compressed with level 9:  62467 bytes (14%)


Processing help-answer
----------------------

Uncompressed:  928 bytes
Compressed with level 0:  938 bytes (101%)
Compressed with level 1:  500 bytes (53%)
Compressed with level 2:  494 bytes (53%)
Compressed with level 3:  494 bytes (53%)
Compressed with level 4:  484 bytes (52%)
Compressed with level 5:  481 bytes (51%)
Compressed with level 6:  481 bytes (51%)
Compressed with level 7:  481 bytes (51%)
Compressed with level 8:  481 bytes (51%)
Compressed with level 9:  481 bytes (51%)


Processing list-active-answer-29462-newsgroups
----------------------------------------------

Uncompressed:  1393931 bytes
Compressed with level 0:  1394151 bytes (100%)
Compressed with level 1:  394856 bytes (28%)
Compressed with level 2:  377907 bytes (27%)
Compressed with level 3:  370632 bytes (26%)
Compressed with level 4:  335238 bytes (24%)
Compressed with level 5:  326645 bytes (23%)
Compressed with level 6:  323482 bytes (23%)
Compressed with level 7:  320722 bytes (23%)
Compressed with level 8:  316907 bytes (22%)
Compressed with level 9:  314809 bytes (22%)


Processing list-active.times-answer-13879-newsgroups
----------------------------------------------------

Uncompressed:  736059 bytes
Compressed with level 0:  736179 bytes (100%)
Compressed with level 1:  113922 bytes (15%)
Compressed with level 2:  112682 bytes (15%)
Compressed with level 3:  112042 bytes (15%)
Compressed with level 4:  99918 bytes (13%)
Compressed with level 5:  98914 bytes (13%)
Compressed with level 6:  98834 bytes (13%)
Compressed with level 7:  98806 bytes (13%)
Compressed with level 8:  94183 bytes (12%)
Compressed with level 9:  94183 bytes (12%)


Processing list-counts-answer-29462-newsgroups
----------------------------------------------

Uncompressed:  1003654 bytes
Compressed with level 0:  1003814 bytes (100%)
Compressed with level 1:  349418 bytes (34%)
Compressed with level 2:  342441 bytes (34%)
Compressed with level 3:  336698 bytes (33%)
Compressed with level 4:  311196 bytes (31%)
Compressed with level 5:  303437 bytes (30%)
Compressed with level 6:  302239 bytes (30%)
Compressed with level 7:  300741 bytes (29%)
Compressed with level 8:  300583 bytes (29%)
Compressed with level 9:  300583 bytes (29%)


Processing list-moderators-answer
---------------------------------

Uncompressed:  335 bytes
Compressed with level 0:  345 bytes (102%)
Compressed with level 1:  197 bytes (58%)
Compressed with level 2:  194 bytes (57%)
Compressed with level 3:  191 bytes (57%)
Compressed with level 4:  190 bytes (56%)
Compressed with level 5:  190 bytes (56%)
Compressed with level 6:  190 bytes (56%)
Compressed with level 7:  190 bytes (56%)
Compressed with level 8:  190 bytes (56%)
Compressed with level 9:  190 bytes (56%)


Processing list-newsgroups-answer-46026-newsgroups
--------------------------------------------------

Uncompressed:  2564921 bytes
Compressed with level 0:  2565321 bytes (100%)
Compressed with level 1:  836486 bytes (32%)
Compressed with level 2:  815978 bytes (31%)
Compressed with level 3:  801596 bytes (31%)
Compressed with level 4:  741846 bytes (28%)
Compressed with level 5:  725255 bytes (28%)
Compressed with level 6:  722740 bytes (28%)
Compressed with level 7:  718912 bytes (28%)
Compressed with level 8:  718244 bytes (28%)
Compressed with level 9:  718244 bytes (28%)


Processing list-overview.fmt-answer
-----------------------------------

Uncompressed:  122 bytes
Compressed with level 0:  132 bytes (108%)
Compressed with level 1:  112 bytes (91%)
Compressed with level 2:  112 bytes (91%)
Compressed with level 3:  112 bytes (91%)
Compressed with level 4:  112 bytes (91%)
Compressed with level 5:  112 bytes (91%)
Compressed with level 6:  112 bytes (91%)
Compressed with level 7:  112 bytes (91%)
Compressed with level 8:  112 bytes (91%)
Compressed with level 9:  112 bytes (91%)


Processing listgroup-answer-with-8605-article-numbers
-----------------------------------------------------

Uncompressed:  53793 bytes
Compressed with level 0:  53808 bytes (100%)
Compressed with level 1:  20177 bytes (37%)
Compressed with level 2:  18186 bytes (33%)
Compressed with level 3:  17369 bytes (32%)
Compressed with level 4:  20509 bytes (38%)
Compressed with level 5:  20277 bytes (37%)
Compressed with level 6:  20320 bytes (37%)
Compressed with level 7:  20329 bytes (37%)
Compressed with level 8:  20329 bytes (37%)
Compressed with level 9:  20329 bytes (37%)


Processing newnews-answer-11096-mid
-----------------------------------

Uncompressed:  474178 bytes
Compressed with level 0:  474258 bytes (100%)
Compressed with level 1:  147513 bytes (31%)
Compressed with level 2:  146515 bytes (30%)
Compressed with level 3:  143855 bytes (30%)
Compressed with level 4:  136598 bytes (28%)
Compressed with level 5:  131718 bytes (27%)
Compressed with level 6:  130759 bytes (27%)
Compressed with level 7:  128550 bytes (27%)
Compressed with level 8:  128067 bytes (27%)
Compressed with level 9:  128067 bytes (27%)


Processing over-answer-1-article
--------------------------------

Uncompressed:  1110 bytes
Compressed with level 0:  1120 bytes (100%)
Compressed with level 1:  530 bytes (47%)
Compressed with level 2:  529 bytes (47%)
Compressed with level 3:  523 bytes (47%)
Compressed with level 4:  524 bytes (47%)
Compressed with level 5:  518 bytes (46%)
Compressed with level 6:  518 bytes (46%)
Compressed with level 7:  516 bytes (46%)
Compressed with level 8:  516 bytes (46%)
Compressed with level 9:  516 bytes (46%)


Processing over-answer-8604-articles
------------------------------------

Uncompressed:  4860880 bytes
Compressed with level 0:  4861630 bytes (100%)
Compressed with level 1:  778648 bytes (16%)
Compressed with level 2:  759093 bytes (15%)
Compressed with level 3:  743074 bytes (15%)
Compressed with level 4:  683428 bytes (14%)
Compressed with level 5:  640402 bytes (13%)
Compressed with level 6:  625390 bytes (12%)
Compressed with level 7:  620066 bytes (12%)
Compressed with level 8:  614138 bytes (12%)
Compressed with level 9:  614047 bytes (12%)



I hope it will help to better implement the COMPRESS command.

-- 
Julien ÉLIE

« Vbi solitudinem faciunt, pacem appellant. » (Galgagus de Tacite)

Technical Details
Message-ID: <n2d9ha$41r$1@news.trigofacile.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.(19219).mbox.7z!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <n2d9ha$41r$1@news.trigofacile.com>
Subject: About compression ratio
Date: Mon, 16 Nov 2015 20:07:21 +0100
From: Julien ÉLIE <iulius@nom-de-mon-site.com.invalid>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.(19219).mbox.7z!not-for-mail
Newsgroups: news.software.nntp
Organization: TrigoFACILE -- http://www.trigofacile.com/
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 16 Nov 2015 19:07:22 -0000 (UTC)
Injection-Info: news.trigofacile.com; posting-account="julien"; posting-host="aaubervilliers-651-1-341-170.w83-114.abo.wanadoo.fr:83.114.228.170";
 logging-data="4155"; mail-complaints-to="abuse@trigofacile.com"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0)
 Gecko/20100101 Thunderbird/38.3.0
X-Mozilla-News-Host: news://news.individual.net:119
X-Received-Body-CRC: 2838062379
X-Received-Bytes: 14689