Author Topic: combining download/decoding/repairing?  (Read 2756 times)

Offline madshi

  • Contributor
  • ***
  • Posts: 25
    • http://www.madshi.net
combining download/decoding/repairing?
« on: February 24, 2008, 11:11:46 AM »
Hey,

right now altbinz is doing everything in multiple steps.

(1) downloading.
(2) decoding.
(3) checking files for reparing.
(4) repairing.
(5) unraring.

Of course for every step all data is read from the harddisk and then again written to the harddisk. So basically every byte of the final file is read and written something like 5 times. Even worse: When there are multiple download threads and decoding is done at the same time, this slows everything down a lot cause having the harddrive read/write so many different files at the same time causes a lot of seeking etc. When dealing with very big downloads this can really eat up PC performance quite a lot. So my thought is this:

Wouldn't it be possible to combine some of these steps? E.g. why doing downloading and decoding in two separate steps? Wouldn't it be possible to decode the downloaded parts on the fly? I'm aware that this might not fully work for incomplete parts (not sure). But still if it was done for complete parts only, it would already bring a noticable performance improvement, I think, due to getting rid of superfluous harddrive activity.

Also I'm wondering about the PAR checking. I've seen that an external exe is currently being used. I'm not sure, but maybe there are PAR checking sources available on the internet? That would allow getting rid of some redundancy. E.g. right now altbinz already checks each downloaded part (and shows it green/red). But if there's a repair necessary, every file is read just another time which costs a lot of performance. Maybe it would be possible to reduce the necessary steps here, too?

Ideally I could imagine something like this:

(1) Downloading, decoding and initial PAR checking is done all at once and in RAM and only the fully decoded data is written to harddisk (and never read again in the first step). PAR checking information is stored in RAM or on harddisk, so that the "checking files for repair" step can be dropped.
(2) If repairing is necessary, it can be done now as a 2nd step, but making use of the PAR checking information already collected in step (1).
(3) Finally, if the parts are zipped or rared, uncompressing can be done now.

This should result in a major performance improvement. It would maybe not improve overall download speed (how long does it take to get a download ready for use) because the download speed is more limited by the online connection speed. But optimizing/combining all those steps should noticably reduce CPU usage and harddisk usage during downloading. Right now I'm often pausing altbinz when I'm doing some real work and when watching a HD movie cause otherwise altbinz is slowing my work down too much or causing stuttering in the HD movie playback.

Offline Hecks

  • Contributor
  • ***
  • Posts: 2011
  • naughty cop
Re: combining download/decoding/repairing?
« Reply #1 on: February 24, 2008, 12:26:22 PM »
On 1), you can already do downloading and decoding in RAM only by configuring properly Setup > Download #2 > Article caching.  That should speed up this part of the process for you at least.

As for your other points, these are constrained somewhat by the linear way in which par2.exe works (run it yourself from the command line and you'll see what I mean).  You can get better performance with the multicore version available in the Daily Builds forum, but there are limits.  Alt.Binz does have issues with very large consecutive downloads (especially if repair is needed) and Rdl is currently exploring the possibilities.

But you should also play with the thread priority and other settings in Setup > Misc #2 to see if that improves performance on your machine (restart Alt.Binz when you change these).

Offline Mystic2010

  • Contributor
  • ***
  • Posts: 165
Re: combining download/decoding/repairing?
« Reply #2 on: February 24, 2008, 03:51:16 PM »
Well I do agree on the PAR checking point. If possible, I'd like to see it behave like Quickpar does when having 'monitor automatically' on.

I would have to agree I would like to see a performance boost in the sence of less CPU and HDD usage as the topicstarter asked for.

So +1 for me if this would be possible
« Last Edit: February 27, 2008, 01:54:23 AM by Mystic2010 »