Raugh, people get this so confused it's no surprise it hasn't been implemented yet.
To cache the files before moving them would be nothing more than reading more files before writing them. It would just involve MyDefrag reading a group of sequential files (perhaps color these... grey?), then move them as normal. Perhaps the level of read-ahead could be adjustable to make the best use of free RAM.
It's been proven countless times that Windows immediately caches the most recent file-read into
free RAM, pushing out old data from the disk cache as new reads occur. If you have 2gb RAM, for example, and only 800mb in use, then read a 600mb AVI movie (perhaps to scan it), there will be no more hard drive activity on subsequent passes, as the
entire file is already read into the disk cache - unused system RAM. Key point:
caching files will have NO EFFECT on pagefile usage. The only potential downside is if the disk cache size decreases (due to opening programs, etc.) and your read-ahead was set too high, the entire effect would be lost since the most recent file (and the first to be moved after pre-reading) was already pushed out of cache. That would mean that, well... we'd get the same (dismal) performance we get now, for that loop.
As for "oh my god what about IF THE DATA CHANGES??!"... um, dude. If Windows didn't know how to cache data that changes, your computer would be a disaster. It would do nothing special, nothing different, than what Windows already does for every other file on your PC. Writes are (almost)
never cached, for more than a few milliseconds. If the data changes, it's immediately written,
and the cached copy in RAM gets updated. This is all stuff that Windows already does behind the scenes.
All MyDefrag would need to do is pre-read a group of files, before having them moved by Windows. That's all. Just the same "safety" as ever. It just throws another step into the process - dummy-reading the files. All it'd do is open the file, read its contents to thin air (null), then close the file. Yes, MyDefrag would read the file into null, not its own memory cache. Windows would handle the caching since the read was made. Then, the defrag API wouldn't have to make a thousand trips back and forth, since "for some reason...", the file was already cached when it went to perform the read!
