![]() |
| CodeBalance® Code Optimizer (con't) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Intuitive Interface | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CodeBalance uses a Graphical User Interface (Fig. 1) to allow the user to specify various options for the optimization process. With a few points and clicks, CodeBalance produces a table of information to guide the user to the next phase of the speed/size trade-offs. CodeBalance produces a table like that shown in Fig. 2. A list of routines common to both programs is shown under the heading, Function. Since the purpose of CodeBalance is to determine speed/size trade-offs routines not common to both programs, or routines which have the same exact code size for both programs are not displayed nor counted in Fig. 2.
The "fastprog" column shows code size in bytes for each routine built for 32-bits. The next two columns, msec and cum%, display the profile timing information for "fastprog." Column msec shows the time spent in each routine listed; the cum% column shows the cumulative percentage of runtime, starting from the most time-critical or bottleneck routines. Column "smallprog" then shows the code size in bytes of "smallprog." The last column ("Code-Savings") shows the cumulative code size savings resulting from compiling the least time-critical routines in 16-bits mode. For example, if the functions main() and polarize() are compiled for 16-bits and the remaining functions are left as 32-bits, the code size savings is 13%. By adding the function eval_parabolic() to the list of 16-bit compiled functions, the savings increases to 22%. The user can select a code compression goal as a percentage of overall code size. For example, by selecting a code compression goal of 35%, CodeBalance will recompile routines in 16-bit mode until a 35% reduction in code size is achieved. Then, CodeBalance will re-profile the application to determine the impact on performance and report this data to the user. Another type of tuning option enables the user to specify the percentage of execution time ("X") to be allocated to 32-bit routines. Here, CodeBalance chooses the most time-critical routines such that X% of the total execution time is compiled for 32-bits. This method ensures that bottleneck routines are kept as fast as possible. Leftover routines are compiled for 16-bits to save space. For example, to ensure that at least the top 75% of the bottleneck code is compiled for maximum speed, CodeBalance would compile gen_pairs, calc_sum, and ion_propagate in 32-bit mode for maximum speed, and the rest in 16-bit mode for minimum code size. CodeBalance can generate an execution profile for the composite application "composite" so that the size/speed trade-off between the original all 32-bits application and the new improved program can be seen (Fig. 3). Here, CodeBalance is shown to have produced a very large code compression of 37% with only a 4% loss in performance. (The code sizes 1544 and 976 in Fig. 3 are not the total code sizes for the two executables. Rather, they are the total sizes for the functions that are common between "fastprog" and "composite". Also, this example is able to use 16-bit mode extensively. So the 32-bit function prologues and epilogues that are normally present are not linked in. This adds up to a big code size reduction of 37%.)
Supported Processors » RTOS » MULTI IDE » AdaMULTI IDE » Compilers » Communications Software » Custom Development |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|