System and method for profile-based, on-the-fly optimization...

Data processing: software development – installation – and managem – Software program development tool – Translation of code

Reexamination Certificate

Rate now

  [ 0.00 ] – not rated yet Voters 0   Comments 0

Details

C717S152000, C717S152000, C717S152000, C717S152000, C709S241000

Reexamination Certificate

active

06202205

ABSTRACT:

BACKGROUND OF THE INVENTION
This invention relates generally to profile-based optimization of software and specifically to dynamic profile-based optimization.
A compiler is a program that converts source code, usually written by a programmer, into object code that executes on a given target computer. A linker then combines a complete set of object code modules into an executable program or a software library. A well-designed compiler optimizes the object code to run most efficiently on the target computer based on pre-determined criteria. The compiler may, for example, produce object code that is optimized for speed, so that the object code will operate as fast as possible on the target computer. A compiler may also be directed to optimize for program size, creating as few instructions as possible in the resulting object code.
Compilers typically optimize for general operation: that is, the optimization algorithm within the compiler determines the set of object code instructions to generate based on its expected or typical operation of the software. To improve the optimization of the compiler, the compiler can be provided “profile data”. Profile data is created by extracting information from previous executions of the software. A program or library that has not been optimized using profile data will be referred to in this specification as an “unoptimized” program or library, even though it may have been generally optimized. The profile data is fed back to the compiler and linker to generate a new fully optimized program or library. Software that has been optimized using profile information based on actual execution of the software will be referred to in this specification as “optimized” software.
To generate profile data, profiling functionality is embedded in the unoptimized software. The unoptimized software with the profiling functionality is executed for a sufficient period of time or number of iterations, to collect a statistically significant quantity of profile data. The sufficient period may be determined by merely timing the execution of the program, or alternatively, by collecting measuring data indicating the number of times specific paths in the software have been executed. The longer the program executes the larger the sample set of data collected and the more accurate the profile data will be. However, after a given period of time, the accuracy may not improve enough to justify the time of further profiling.
This profile data contains statistical data such as the unoptimized software's pattern of accessing data or a profile of the paths executed by the unoptimized software. Once the profile data is collected it is used to produce optimized software. The profile data is input into a compiler tool along with source code to produce optimized object code. The optimized object code is provided to a linker to create optimized software. The linker may also use the profile data to optimize the library. The profile data may indicate routines within the library that are more likely to call each other. By clustering these routines next to each other, the routines will occupy the same page of memory. Calls between these routines will be performed more efficiently because the time consuming tasks of jumping back and forth between different memory pages is minimized.
As examples of optimization based on profiling software, the optimized software may branch more efficiently by testing for the most likely branch condition first. It may also use memory more efficiently, by keeping data more likely to be used in cache memory or registers, thereby speeding access to frequently used data.
Profile based optimization requires a feedback system of collecting the profile data and using it to create a new executable program or library. Conventionally, this requires restarting the software application to take advantage of the optimization. If the software that is profiled is an application, the old application will have to be replaced by the new application and restarted. If the software that is profiled is a library, the application will have to relink to the new library and be restarted.
Software libraries are often provided by vendors, either by delivering the library to the end-user system or allowing the user's application to access a system where the library resides. Before the library is used by the end-user, the vendor can only optimize the library based on “typical” execution of its library. It is inconvenient to require the user to execute his software twice, once to produce a profile and a second time to use a new library created based on that profile. For this reason, software libraries are rarely optimized to run most efficiently based on the specific needs of the end-user application.
Therefore, there is a need to provide a system and a method to perform a profile based optimization of a software library without requiring replacement and restarting of the application to obtain the benefits of the optimized library.
Further, there is a need for a convenient way to optimize a software library without intervention by the library supplier based on the execution patterns of the software library by an end-user application.
SUMMARY OF THE INVENTION
The present invention provides a system and method to perform on-line profile based optimization of a software library. According to the invention, this is accomplished by profiling an unoptimized software library while it is used by an application, using the resulting profile data to create an optimized software library and then replacing the unoptimized software library with the optimized software library without restarting the application.
This invention takes advantage of a system and method for replacing libraries on-the-fly, described in the commonly-assigned application Ser. No. 09/120,040 filed Jul. 21, 1998 and entitled SYSTEM AND METHOD FOR ON-LINE REPLACEMENT OF SOFTWARE. The system and method of replacing libraries on-the-fly requires that the application and the replaceable library are not linked or run-time bound to each other. The application, instead, is linked to an interface library that contains proxy interfaces for all routines found in the replaceable library. The interface library can, at run-time, determine the location of the replaceable library by the use of a registry directing it to the current version of the replaceable library. When the replaceable library is changed during execution of the application, the interface library detects the change by examining the registry, where it also determines the location of the updated replaceable library. The system and method of replacing libraries on-the-fly allows for replacing libraries without restarting the application.
This invention also takes advantage of the use of a hierarchical registry allowing for multiple applications to use different versions of a library simultaneously. This technique is described in the commonly assigned application Ser. No. 09/120,037 filed Jul. 21, 1998 entitled A HIERARCHICAL REGISTRY FOR HP-UX LIBRARIES.
By taking advantage of the ability to replace libraries without restarting the application, a library can be profiled, a new optimized library can be built and the application can use the optimized library without interfering with the application's execution. Profiling now can be done and not even be detected by the application. During the time of profiling performance may be slower, but upon completion of profiling and construction of the optimized library performance of the library will be better than even before the profiling.
The ability to profile and generate an optimized library that can be used without restarting creates a significantly more convenient method of profiling a library based on the actual execution of an end-user application. Library providers may now profile and create an optimized library specifically tailored to the application.
The optimized library is built from the same base software used to build the unoptimized library, but also factors in the profile data. The base software may be source

LandOfFree

Say what you really think

Search LandOfFree.com for the USA inventors and patents. Rate them and share your experience with other people.

Rating

System and method for profile-based, on-the-fly optimization... does not yet have a rating. At this time, there are no reviews or comments for this patent.

If you have personal experience with System and method for profile-based, on-the-fly optimization..., we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and System and method for profile-based, on-the-fly optimization... will most certainly appreciate the feedback.

Rate now

     

Profile ID: LFUS-PAI-O-2455475

  Search
All data on this website is collected from public sources. Our data reflects the most accurate information available at the time of publication.