Article View: news.software.nntp
Article #56851Re: [yEnc] some newbie questions
From: Curt Welch
Date: Sat, 23 Feb 2002 18:52
Date: Sat, 23 Feb 2002 18:52
53 lines
3989 bytes
3989 bytes
Liyang Hu <newsgroups@nerv.cx> wrote: > J.B. Moreno <planb@newsreaders.com> wrote: > > In article <a540dn$7i4$7@pegasus.csx.cam.ac.uk>, Liyang Hu > > <newsgroups@nerv.cx> wrote: > >> J.B. Moreno <planb@newsreaders.com> wrote: > >> > The encoder is (according to the author) CPU intensive. > >> It shouldn't be. (Not to the extent where it can slow down your > >> download speed!) It must not have been implemented correctly. > > Not the download speed, the upload speed -- don't know the > > details, but encoding takes longer than decoding. > > So I meant to say `upload', cheers. > > But the point remains -- the encoder and decoder should be of the > same level of complexity, ie. O(N). I don't see how one could be > significantly slower than the other, provided they were implemented > correctly. Yes, 100*O(N) is still O(N) but it's 100 times slower. Do you not see something that takes 100 times longer as significant? The fact that both algorithms are O(N)is mostly meaningless to this type of discussion. The b-news system which uses base 224 has to convert 320 bit (40 byte) binary numbers into 41 character base224 numbers. That required a lot of CPU time for a simple "encoding". If you wanted to do base 251 encoding, the first best-fit between Base2 numbers and Base251 numbers happens at 280 bytes or 2240 bits. So to convert each 280 bytes of raw data into 281 characters of encoded data, you have to do 281 divisions of a 2240 bit binary number by 251. That's a lot of CPU work. You are talking something on the order of 100 integer divisions plus subtractions plus data shuffling for _each_character_encoded_. That's probably at least 100 times slower than yEnc. And that's not true base 251 encoding. It's just a close fit to allow the algorithm to remain O(N). If you wanted true base 251 encoding you would have to treat the entire input file as one huge binary numbers and the problem would become O(N^2). Maybe there is a way to do that quicker, but I don't know what it is. Feel free to code it and let us do a few timing tests on it and see how significant it is or it isn't. CPU speed these days vs. download speed gives us a lot of extra CPU power to work with, but I suspect base251 encoding would eat up more CPU than most people would be willing to give to the problem. It's likely to be at least 100 times slower than yEnc. -- Curt Welch http://CurtWelch.Com/ curt@kcwc.com Webmaster for http://NewsReader.Com/
Technical Details
Message-ID:
<20020223135211.154$cg@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!news2.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.cwix.com!newsfeed1.cidera.com!Cidera!feed2.newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mailReferences:
<3c6e6798.9093644@news> <a4kc41$ou1$2@pegasus.csx.cam.ac.uk> <yleljh722r.fsf@windlord.stanford.edu> <04477.k22202@archiver.winews.net> <a500oj$736$1@pegasus.csx.cam.ac.uk> <Xns91BC3666AD674JanC@213.119.4.20> <3C74D21B.F49E2F9F@proxad.net> <210220021418431479%planb@newsreaders.com> <a540dn$7i4$7@pegasus.csx.cam.ac.uk> <210220022120391303%planb@newsreaders.com> <a57u73$86r$2@pegasus.csx.cam.ac.uk>Show Full Headers
Complete Article Headers
Message-ID: <20020223135211.154$cg@newsreader.com>
Subject: Re: [yEnc] some newbie questions
Date: Sat, 23 Feb 2002 18:52:11 +0000
From: curt@kcwc.com (Curt Welch)
References: <3c6e6798.9093644@news> <a4kc41$ou1$2@pegasus.csx.cam.ac.uk> <yleljh722r.fsf@windlord.stanford.edu> <04477.k22202@archiver.winews.net> <a500oj$736$1@pegasus.csx.cam.ac.uk> <Xns91BC3666AD674JanC@213.119.4.20> <3C74D21B.F49E2F9F@proxad.net> <210220021418431479%planb@newsreaders.com> <a540dn$7i4$7@pegasus.csx.cam.ac.uk> <210220022120391303%planb@newsreaders.com> <a57u73$86r$2@pegasus.csx.cam.ac.uk>
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!news2.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.cwix.com!newsfeed1.cidera.com!Cidera!feed2.newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
Organization: NewsReader.Com
Newsgroups: news.software.nntp
X-Trace: NewsReader.Com W/CeQ.f@QQ_qTlXtJxw4FSj=q7Z3g8DsTjEuxEK@-sMsawa
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: 52