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.