The inefficient but correct analysis model can be optimized to make implementation
more efficient. To optimize the design, the following things should be done:
1. Adding Redundant Associations for Efficient Access
Redundant associations do not add any information, thus during design we should actually examine the structure of object model for implementation, and try to establish whether we can optimize critical parts of the completed system. Can new associations be added, or old associations be removed? The derived association need not to add any information to the network, they help increasing the model information in efficient manner.
We can analyze the use of paths in the association network as follows:
- Evaluate each operation
- Find associations that it must pass through to get information. Associations can be bi-directional (generally by more than one operation), or unidirectional, which can be implemented as pointers.
For each operation, we should know the followings:
- How frequently is the operation needed, and how much will it cost?
- What is the fan-out along a path through the network? To find fan-out of the complete path, multiply the average count of each “many” associations found in the path with individual fan-outs.
- What are the objects that satisfy the selection criteria (if specified) and are operated on? When most of the objects are rejected during traversal for some reason, then a simple nested loop may be inefficient at finding target objects.
2. Rearranging the Execution Order for Efficiency
As we already know algorithm and data structure are closely related to each other, but data structure is considered as the smallest but very important part of algorithm.
Thus, after optimizing the data structure, we try to optimize the algorithm itself. In general, algorithm optimization is achieved by removing dead paths as early as possible. For this, we sometimes reverse the execution order of the loop from the original functional model.
0 comments:
Post a Comment