To understand directory optimization you first have to understand the way that the directory is internally organized. If you don't want to read the details it is enough to know that the data structures in the directory can be internally fragmented and use space inefficiently. Directory optimization is the process of organizing the data structures for fastest access. Directory optimization typically results in a 50% to 60% decrease in the time it takes programs to scan the directory and a 10% to 20% decrease in startup time. If you want the details then read on.
To start with, Mac OS Standard (HFS) and Mac OS Extended (HFS Plus) disk directories have a very complex structure. Each file or folder (item) on a disk has an entry in the disk's directory. These entries are in order of enclosing folder and then item name. This is similar to a yellow pages directory being ordered by type of business and then business name. Just like a yellow pages directory, the disk directory has pages--except that its pages are called nodes. Unlike the yellow pages, nodes are dynamic and change as you add and delete items. It's sort of like a realtime yellow pages.
Imagine that the pages of the yellow pages are not in order and at the bottom of each page it says "Continued on page n," where n is the page that contains the next set of listings for the particular type of business that you're looking up. Well, nodes are not necessarily arranged in order and each node has a reference, or link, to the next node that contains the next set of ordered items.
When you have a fresh new directory, all of the nodes are in order. So node 1 has a link to node 2 which has a link to node 3, and so on. Nodes don't stay in order for very long. Whenever a file or folder (item) is created, an entry for the item is added to the directory in the appropriate node. When a node fills up, a new node is added and the entries are divided evenly between the old node and the new node. This leaves both nodes only half full. The new node is most likely going to be at the end of the directory, just like an addendum. To keep the the items in the nodes in order, node 1--which was previously linked to the old node--will link to the new node and the new node will link to the old node.
Need an example? Let's say that you have a directory with 3 nodes and node 1 links to node 2 which links to node 3. If you add an item that causes node 2 to overflow, a new node 4 will be added and the items from node 2 and the new item will be split between node 2 and node 4. Node 1 will link to node 4 and node 4 will link to node 2 causing the nodes to be out of order. The links indicate the order in which the nodes are to be read. Following the links you visit all of the nodes and items in the correct order. However, to follow the links you will have to jump from node 1 to node 4 then back to node 2 and then to node 3. As more items are added to the directory, this process of splitting is repeated and the nodes are increasingly out of order. A typical directory has hundreds or thousands of nodes. If a program or the Mac OS needs to search the directory it will follow the links and jump back and forth in the directory.
Directory optimization is the process of defragmenting and packing nodes. Defragmenting makes the physical order equal the linked (logical) order. Packing combines nodes that are not full so that you end up with fewer nodes. Continuing with the directory in the previous example, the directory is defragmented and the items are packed into just 2 nodes. The resulting speed increase is due to the fact that fewer nodes need to be read and there is no need to jump around within the directory.
Example directory with 3 nodes. Files are in order.
Adding "File H" causes node 2 to split and fragment the directory.
Optimizing defragments and removes unnecessary nodes.
About Directory Optimization Grapher
Directory Optimization Grapher creates an optimization graph that indicates the degree the directory is internally fragmented. It doesn't just indicate the number of fragments. You can visually determine the number of fragments and the distance each fragment is out of place. Note: Directory Optimization Grapher does not (and can not) modify the directory or any other part of the disk in any way while graphing a directory.
Using Directory Optimization Grapher
To graph a disk:
1) Open the Directory Optimization Grapher or if it's already open, choose the New Graph command from its File menu. A dialog will appear with a list of disks.
2) Choose the disk whose directory you want to graph. A progress dialog will appear and, after a brief delay, it will be replaced with a window containing the graph.
To save a graph:
1) Choose "Save as Picture" from the File menu. A standard save window appears.
2) Pick a location and enter a name for the saved graph.
Understanding the Graph
Each part (node) of the the directory is assigned a color along a gradient between white and dark blue depending upon its optimized position. The graph of a perfectly optimized directory is a perfect gradient from white to blue. Fragmentation interrupts the gradient. The more distant a fragment is from its optimized position, the greater the difference between the color of the fragment and the color of the same position in the example optimized graph.
Directory optimization is the process of defragmenting and packing nodes. Defragmenting makes the physical order equal the linked (logical) order. Packing combines nodes that are not full so that you end up with fewer nodes. The graph does not indicate whether the nodes need to be packed. It would take a completely different representation of the nodes to indicate that information. However, fragmentation has a far greater impact on performance. It is much worse to jump around from one part of the directory to another than to read some extra nodes.
The bottom line is that the more nodes that are out of order, the more files and folders are out of order and the more impact you'll see on performance. True directory optimization is an exclusive feature of Alsoft's DiskWarrior. You can find information about DiskWarrior at http://www.Alsoft.com/DiskWarrior/index.html. No other utility has the ability to defragment your directory.
Graph of a Typical Hard Disk Before Optimization
Graph of the Same Disk After Optimization, Nodes are Packed and In Order
Directory Optimization Grapher is free and is courtesy of Alsoft, Inc. It is not to be distributed without the express written consent of Alsoft, Inc.
Directory Optimization Grapher is provided "AS IS" and you use it at your sole risk.
UNDER NO CIRCUMSTANCES, INCLUDING NEGLIGENCE, SHALL ALSOFT, OR ITS DIRECTORS, OFFICERS, EMPLOYEES, OR AFFILIATES BE LIABLE FOR ANY INCIDENTAL, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO DIRECTORY OPTIMIZATION GRAPHER.
Directory Optimization Grapher is compatible with all 68K Macintoshes and all Power Macintoshes with Mac OS 7.6 and later. However, Appearance Manager 1.0.1 or later is required. Appearance Manager 1.0.1 was first included with Mac OS 8.1. Appearance Manager 1.0.4 is available free at http://developer.apple.com/sdk/index.html and is backward compatible with Mac OS 7.1 and later. Note: the Appearance Manager is not the same as the Appearance control panel.
QuickTime 4 is required to save a graph. In addition, you must have the QuickTime Image extension in the QuickTime Extensions folder within the Extensions folder in your System Folder. If you have not installed QuickTime 4, it is available free at http://www.apple.com/quicktime. If you have QuickTime 4 installed but you do not have the QuickTime Image extension then run the QuickTime Updater, click the Custom button, select QuickTime Still Image and then click the Update Now button.
Graphs do not draw properly unless you have your monitor set to thousands or millions of colors. If you cannot set your monitor to more than 256 colors you may need to reduce your monitor resolution.
Copyright 1999 Alsoft, Inc. All rights reserved.
This page was created using TextToHTML. TextToHTML is a free software for Macintosh and is (c) 1995,1996 by Kris Coppieters