Intro Download and install Frequently Asked Questions Tips and tricks

Homepage







© J.C. Kessels 2009
MyDefrag Forum
June 18, 2013, 11:51:51 pm *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: SortByName relaxation  (Read 1418 times)
Frunobulax
JkDefrag Supporter
***
Posts: 12


View Profile
« on: November 10, 2009, 10:52:48 am »

Hi,

as a C++ developer I have to work with a huge number of files -- a typical branch has 50.000-100.000 files, and the compiler will read 1.000-2.000 headers to compile a single file. Naturally "simple" defragmentation will not work in this case because classic defragmentation will still leave all those files scattered across the disc (or rather the used space). A "sort by filename" is the defragmentation of choice.

However, since every compile process creates and replaces a lot of object files, the HD will fragment extremely fast. Running a "sort by filename" takes very long time because it reorganises everything, but at the moment that's the only thing I can do.

Would it be possible to run a "consolidation" process that treats a directory just as a large file and tries to move all files in this directory instead of a complete reordering? Clearly some user input would be required to identify the directories that should be grouped. One could identify specific directories, or set a depth - say all directories that are X levels below root are consolidated. For a standard windows system one could group files starting in the second directory, so all files in an installation foo in "c:\program files\foo" would be grouped.

tv
Logged
BloodySword
JkDefrag Hero
*****
Posts: 1114



View Profile
« Reply #1 on: November 10, 2009, 11:21:06 am »

That will be not effective, though. I think you should buy a SSD hard drive. This little buddies are VERY FAST on Writing and Reading with extremly randomly LBA locations.
Or you should simply choose an HDD wich has very good access times and you should work with these files in the very first partition of this HDD to make sure, that these files
are on the beginning of the drive and therefore the access will be significant faster.

For your purpose, defragmenting for optimizing such huge and complex amount of files and dirs is not a good idea. PErmanent defragmenting is very time intensive and at the end it is not very effective because the defragmentation takes more time than the time wich is safed for compiling your big projects. A faster HDD or even an SSD (Solid State Disc) would solve your performance losings.  Grin


Edit:
If you still want to do such optimizations: MyDefrag is able to create zones. With DirectoryPath you can select all these files of a path to sort them by name. You can combine multiple paths to one zone by using the OR operator. SortByName will then sort the files of the dirs in one zone and brings them together. But I still think that this is not a good idea and would tend to consume more defragmentation time than time wich will be saved on compiling.
« Last Edit: November 10, 2009, 11:28:12 am by BloodySword » Logged

Greetings from Germany!
jeroen
Administrator
JkDefrag Hero
*****
Posts: 7156



View Profile WWW
« Reply #2 on: November 10, 2009, 11:28:09 am »

Would it be possible to run a "consolidation" process that treats a directory just as a large file and tries to move all files in this directory instead of a complete reordering?
Not exactly. What you could do is make a MyDefrag script that puts all the files of a branch in a separate zone. You can then optimize and defragment with fastfill, much faster than sortby.
Logged
BloodySword
JkDefrag Hero
*****
Posts: 1114



View Profile
« Reply #3 on: November 10, 2009, 11:44:19 am »

A cheaper way of speeding this up would be: *rataplan* A RAMDisk. You should first test how big the data amount of the temporary obj files actually is on your biggest project. Do not look at the file sizes, just look on the file sizes ON DRIVE (with cluster tips, and other overhead.) No add ca. 33% to this value and you have a save size of your
RAMDrive. So now you must have at least the double of the RAMDirve size free available RAM to work in a stable environement.

Now you can configure your compiler to use the RAMDrive as temporary directory for storing the obj files. After linking you can delete the files out of the RAMDisc if the linker didn't this automalicy.

Alhtough RAM-Modules have not a good price/GB ratio, this solution would be even cheaper if you must upgrade your RAM.

RAMDisk driver
« Last Edit: November 10, 2009, 11:47:00 am by BloodySword » Logged

Greetings from Germany!
Frunobulax
JkDefrag Supporter
***
Posts: 12


View Profile
« Reply #4 on: November 11, 2009, 09:06:46 am »

A cheaper way of speeding this up would be: *rataplan* A RAMDisk.

I do work on a ramdisk on the main branch (at least I store all compiler-generated files there, the sources are naturally on a hard disk). But there is only so much space.

As far as SSDs are concerned, yes, they would be nice. And I've tried to convince our IT for half a year that we need some of these buggers, so with any luck we should get some in 2011.

The speedup due to defragmentation (sort by name) is in the range between 25% and 33%, that's significant.

tv
Logged
BloodySword
JkDefrag Hero
*****
Posts: 1114



View Profile
« Reply #5 on: November 11, 2009, 10:02:50 am »

The speed up of a defragmentation might be significant. But the effort to get this is higher and the time takes longer as the speed-up will last. So the costs of defragmenting can be higher than if you simply upgrade to SSDs.

If you still want to defrag you can test it:

Select all .cpp .h and other files and sort them by name. Then if fragmentation occurs, use fast fill with shuffling. And every month or week, repeat defragmentation with SortByName. This could get speed and the effort is lower.
Logged

Greetings from Germany!
jeroen
Administrator
JkDefrag Hero
*****
Posts: 7156



View Profile WWW
« Reply #6 on: November 11, 2009, 11:54:34 am »

The speedup due to defragmentation (sort by name) is in the range between 25% and 33%, that's significant.
Time saved multiplied by salary per hour equals a nice donation? Smiley
Logged
Frunobulax
JkDefrag Supporter
***
Posts: 12


View Profile
« Reply #7 on: November 11, 2009, 03:52:20 pm »

Well, if we manage to run defragmentation overnight then maybe we can work something out :-)
We are fighting hefty performance problems, see "Very slow performance with huge files" in the bugs section.
Logged
jeroen
Administrator
JkDefrag Hero
*****
Posts: 7156



View Profile WWW
« Reply #8 on: November 11, 2009, 05:17:00 pm »

See the How can I run MyDefrag automatically every day? page for instructions.
Logged
Frunobulax
JkDefrag Supporter
***
Posts: 12


View Profile
« Reply #9 on: November 12, 2009, 03:51:51 pm »


This will tell me how to reduce the MyDefrag runtime from an estimated 100 hours to 10 hours or so? ;-)

tv
Logged
Bibby
JkDefrag Senior
****
Posts: 24


View Profile
« Reply #10 on: November 12, 2009, 08:25:38 pm »

When I first read the topic title my initial thought was relaxing the SortBy method by adding a further parameter such as the following:

FileSelect
  ....
FileActions
  # Sort filenames in ascending order and only move the next consecutive filename if more than 1% of volume away from the previous file
  SortByName(Ascending, 1%)
FileEnd

So for example if b.jpg is over 60MB in distance (on a 6GB volume) from a.jpg then it will move it as normal - otherwise if it was less than 60MB distance it can leave it in place allowing the SortBy method to work faster.

I suppose the only problem with this would be that b.jpg would then be classed as unmovable otherwise it may be moved out of the way later on in the same run on that volume.
« Last Edit: November 12, 2009, 08:30:31 pm by Bibby » Logged
cg
JkDefrag Hero
*****
Posts: 101


View Profile
« Reply #11 on: November 12, 2009, 09:27:17 pm »

That's a pretty cool idea.  I'd just add that it would still need to move the file if it were in a different zone but within the 60 megs... You still want your zones correct.
Logged
jeroen
Administrator
JkDefrag Hero
*****
Posts: 7156



View Profile WWW
« Reply #12 on: November 12, 2009, 09:58:19 pm »

This will tell me how to reduce the MyDefrag runtime from an estimated 100 hours to 10 hours or so? ;-)
Yes, if you use the Daily script instead of the Monthly script.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!