Object code optimizer
Encyclopedia
An object code optimizer, sometimes also known as a post pass optimizer or, for small sections of code, peephole optimizer
Peephole optimization
In compiler theory, peephole optimization is a kind of optimization performed over a very small set of instructions in a segment of generated code. The set is called a "peephole" or a "window"...

, takes the output from a source language compile step - the object code or binary file
Binary file
A binary file is a computer file which may contain any type of data, encoded in binary form for computer storage and processing purposes; for example, computer document files containing formatted text...

 - and tries to replace identifiable sections of the code with replacement code that is more algorithmically efficient
Algorithmic efficiency
In computer science, efficiency is used to describe properties of an algorithm relating to how much of various types of resources it consumes. Algorithmic efficiency can be thought of as analogous to engineering productivity for a repeating or continuous process, where the goal is to reduce...

 (usually improved speed).

Examples

  • The "COBOL Optimizer" developed by Capex Corporation
    Capex Corporation
    Capex Corporation was a software house based in Phoenix, Arizona founded by three former employees of General Electric. It was subsequently acquired by Computer Associates.-Products:* Autotab - an early batch spreadsheet program...

     in the mid 1970's for COBOL
    COBOL
    COBOL is one of the oldest programming languages. Its name is an acronym for COmmon Business-Oriented Language, defining its primary domain in business, finance, and administrative systems for companies and governments....

    . This type of optimizer depended, in this case, upon knowledge of 'weaknesses' in the standard IBM COBOL compiler, and actually replaced (or patch
    Patch (computing)
    A patch is a piece of software designed to fix problems with, or update a computer program or its supporting data. This includes fixing security vulnerabilities and other bugs, and improving the usability or performance...

    ed) sections of the object code with more efficient code. The replacement code might replace a linear table lookup
    Lookup table
    In computer science, a lookup table is a data structure, usually an array or associative array, often used to replace a runtime computation with a simpler array indexing operation. The savings in terms of processing time can be significant, since retrieving a value from memory is often faster than...

     with a binary search for example or sometimes simply replace a relatively 'slow' instruction with a known faster one that was otherwise functionally equivalent within its context. This technique is now known as "Strength reduction
    Strength reduction
    Strength reduction is a compiler optimization where expensive operations are replaced with equivalent but less expensive operations. The classic example of strength reduction converts "strong" multiplications inside a loop into "weaker" additions – something that frequently occurs in array...

    ". For example on the IBM/360 hardware the CLI instruction was, depending on the particular model, between twice and 5 times as fast as a CLC instruction for single byte comparisons.

Advantages

The main advantage of this method was that the stock of already compiled customer programs (object code
Object code
Object code, or sometimes object module, is what a computer compiler produces. In a general sense object code is a sequence of statements in a computer language, usually a machine code language....

) could be improved almost 'instantly' with minimum effort, reducing CPU resources at a fixed cost (the price of the proprietary software
Proprietary software
Proprietary software is computer software licensed under exclusive legal right of the copyright holder. The licensee is given the right to use the software under certain conditions, while restricted from other uses, such as modification, further distribution, or reverse engineering.Complementary...

). A disadvantage was that new releases of COBOL, for example, would require (charged) maintenance to the optimizer to cater for possibly changed internal COBOL algorithms. However, since new releases of COBOL compilers frequently coincided with hardware
Hardware
Hardware is a general term for equipment such as keys, locks, hinges, latches, handles, wire, chains, plumbing supplies, tools, utensils, cutlery and machine parts. Household hardware is typically sold in hardware stores....

 upgrades, the faster hardware would usually more than compensate for the application programs reverting to their pre-optimized versions (until a supporting optimizer was released).

Other optimizers using the same concept

Some binary optimizers seek to reduce only the size of binary files by eliminating duplicate library modules - without necessarily also improving their performance, while others utilize run-time metrics to introspectively improve performance using techniques similar to JIT
Just In Time
Just in time is a production strategy that strives to improve a business return on investment by reducing in-process inventory and associated carrying costs. Just-in-time production method is also called the Toyota Production System...

 compilers.

Recent developments

More recently developed 'binary optimizers' for various platforms, some claiming novelty
Novelty (patent)
Novelty is a patentability requirement. An invention is not patentable if the claimed subject matter was disclosed before the date of filing, or before the date of priority if a priority is claimed, of the patent application....

 but, nevertheless, essentially using the same (or similar) techniques described above, include:-
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK