🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #56737

Re: [yEnc] Survey time! (Compression or not?)

#56737
From: Curt Welch
Date: Thu, 21 Feb 2002 20:26
91 lines
5436 bytes
Jeremy <jeremy@exit109.com> wrote:
> Curt Welch <curt@kcwc.com> wrote:
>
> >>> Compression or not?
> >>
> >> Not as part of the encoding.
> >
> > Why not?
>
> Because it's stupid.

I figured you might be looking at it like that. :)

> Most of the things posted as binaries are already
> compressed, so an additional compression step would be wasteful and may
> actually make the resulting post larger in many cases.

I was just looking over the zlib stuff (www.zlib.org).  They designed the
algorithm to limit the worse case expansion by allowing a pass-though mode.
The algorithm works on blocks, and when it finds it can't compress the
block, it's just marks it as uncompressed.  The overhead for the "mark" is
5 bytes per 32K block.  That less than .02%. (not 2% but .02%).

zlib seems to be bascially the same code a gzip (thought I'm unclear as to
the differences).

But taking a 56725 byte jpg off of usenet and running it though gzip, I get
a a file which is 301 bytes smaller.  A .5% compression on a file which was
already compressed.

Taking a 3.3 MB mp3 files off of usenet and running it though gzip, it
reduces the file by 46505 bytes.  That's over a 1% savings.

So I think your fear about "may make the file larger" is probably
unfounded.

It may be larger for some files, but by only 5 bytes per 32K worse case.

> Those few things
> that aren't already compressed can and should easily be compressed
> outside of the encoding step.

If it's a standard part of the system, then users will never have to bother
with the extra steps "outside" of their newsreader.

The problem with doing it outside of the encoding is that people will do it
many different ways.  Some will use zip, some will use gzip, or rar, etc.
It's all a function of what that user has access to and works best for him.

If we were to take something like the zlib work and make that a standard,
then everyone that has a yEnc compatibale newsreader will have the correct
tool for decompressing and not have to go to the trouble of finding a copy
of the right tool, or moving files to a machine which has the right tool
just so you can decompress it.

The problem with having to compress the file every time however is that it
prevents the client from knowing important things like the total number of
bytes before the file is posted.  To get that stuff (and correctly
calculate part sizes and number of parts) requires the user posting the
file to compress the file before hand.  For large files which really don't
need compressing (like mp3 files) that would sure be a pain.  And if you
are short on disk space, might not even be possible to compress and save a
copy of the compressed version.

So it might be wise to make the compression a well defined part of the
standard, but optional.  So the person posting would always have the option
of letting the posting client compress using the yenc standard way of
compressing, but if they knew compressing was just a waste of time, then
they could skip it.  But then, people reading the posts would never have to
go find the "correct" compression tool to decode the post.  The file name
would still be picture.bmp instead of picture.zip or picture.gz, the yEnc
headers would simply enclude an extra keyword to show it was was compressed
so all that could be hidden from the users trying to get the file.

I don't think this should be thought of as only an "encoding". It's a
standard for how binary files should be posted on usenet.  And because
compression is so important for usenet, I think it makes a lot of sense to
consider making the compression step part of the standard.

zlib sure looks like the solution to the problem as well because it's
availbale on a wide range of platforms and it is free from any license
restrictions and it seems to work very well for this type of application
(with the included limits on worse case expansion etc).

More thought and testing has to be put into this, but I think it would be a
mistake to write it off so quickly.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Technical Details
Message-ID: <20020221152617.647$FV@newsreader.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.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!cpk-news-hub1.bbnplanet.com!news.gtei.net!newsfeed1.cidera.com!Cidera!feed1.newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
References: <a504os$736$6@pegasus.csx.cam.ac.uk> <200220022141483852%planb@newsreaders.com> <20020220230116.405$a3@newsreader.com> <1014270020.729921@ok-corral.gunslinger.net>

Show Full Headers
Complete Article Headers
Message-ID: <20020221152617.647$FV@newsreader.com>
Subject: Re: [yEnc] Survey time! (Compression or not?)
Date: Thu, 21 Feb 2002 20:26:17 +0000
From: curt@kcwc.com (Curt Welch)
References: <a504os$736$6@pegasus.csx.cam.ac.uk> <200220022141483852%planb@newsreaders.com> <20020220230116.405$a3@newsreader.com> <1014270020.729921@ok-corral.gunslinger.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!cpk-news-hub1.bbnplanet.com!news.gtei.net!newsfeed1.cidera.com!Cidera!feed1.newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
Organization: NewsReader.Com
Newsgroups: news.software.nntp
X-Trace: NewsReader.Com FXJ6jUkxNgr/eJaGlO14xyyU56YD+xy-mZY4BCVxLXZAPc
X-Face: "p}G*1KH{+F7EYGKLb>ogDguabZ+%,?^epeFB!nzu`)`$=QcvL1KF6<0GH!Tbc!Sqo[|tV5
  %IW48mQf3K=Ci&gZ7]]aazx@]Y-nq!r5{yH/#,?@lDdUDvOfByB2hVW0.@OM%{l/{cT'{w
X-Url: http://CurtWelch.Com/
User-Agent: NewsReader.Com
Lines: 90