HOME

TheInfoList



OR:

An object code optimizer, sometimes also known as a post pass optimizer or, for small sections of code,
peephole optimizer Peephole optimization is an optimization technique performed on a small set of compiler-generated instructions; the small set is known as the peephole or window. Peephole optimization involves changing the small set of instructions to an equiva ...
, takes the output from a source language compile step - the object code or
binary file A binary file is a computer file that is not a text file. The term "binary file" is often used as a term meaning "non-text file". Many binary file formats contain parts that can be interpreted as text; for example, some computer document fi ...
- and tries to replace identifiable sections of the code with replacement code that is more algorithmically efficient (usually improved speed).


Examples

* " IBM Automatic Binary Optimizer for z/OS" (ABO) was introduced in 2015 as a cutting-edge technology designed to optimize the performance of
COBOL COBOL (; an acronym for "common business-oriented language") is a compiled English-like computer programming language designed for business use. It is an imperative, procedural and, since 2002, object-oriented language. COBOL is primarily ...
applications on
IBM Z IBM Z is a family name used by IBM for all of its z/Architecture mainframe computers. In July 2017, with another generation of products, the official family was changed to IBM Z from IBM z Systems; the IBM Z family now includes the newest mo ...
mainframes without the need for recompiling source. It uses advanced optimization technology shipped in the latest Enterprise COBOL. ABO optimizes compiled binaries without affecting program logic. As a result, the application runs faster but behavior remains unchanged so testing effort could be reduced. Clients normally don't recompile 100 percent of their code when they upgrade to new compiler or IBM Z hardware levels, so code that's not recompiled wouldn't be able to take advantage of features in new IBM Z hardware. Now with ABO, clients have one more option to reduce
CPU A central processing unit (CPU), also called a central processor, main processor or just processor, is the electronic circuitry that executes instructions comprising a computer program. The CPU performs basic arithmetic, logic, controlling, and ...
utilization and operating costs of their business-critical COBOL applications. You can try ABO out with an improved, easy-to-use ABO Trial Cloud Service without installing ABO on your system. * The earliest "COBOL Optimizer" was developed by Capex Corporation in the mid 1970s for
COBOL COBOL (; an acronym for "common business-oriented language") is a compiled English-like computer programming language designed for business use. It is an imperative, procedural and, since 2002, object-oriented language. COBOL is primarily ...
. This type of optimizer depended, in this case, upon knowledge of 'weaknesses' in the standard IBM COBOL compiler, and actually replaced (or
patch Patch or Patches may refer to: Arts, entertainment and media * Patch Johnson, a fictional character from ''Days of Our Lives'' * Patch (''My Little Pony''), a toy * "Patches" (Dickey Lee song), 1962 * "Patches" (Chairmen of the Board song ...
ed) sections of the object code with more efficient code. The replacement code might replace a linear
table lookup In computer science, a lookup table (LUT) is an array that replaces runtime computation with a simpler array indexing operation. The process is termed as "direct addressing" and LUTs differ from hash tables in a way that, to retrieve a value v wi ...
with a
binary search In computer science, binary search, also known as half-interval search, logarithmic search, or binary chop, is a search algorithm that finds the position of a target value within a sorted array. Binary search compares the target value to the m ...
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. 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 re-optimizing existing programs was that the stock of already compiled customer programs (
object code In computing, object code or object module is the product of a compiler. In a general sense object code is a sequence of statements or instructions in a computer language, usually a machine code language (i.e., binary) or an intermediate lang ...
) could be improved almost instantly with minimal effort, reducing
CPU A central processing unit (CPU), also called a central processor, main processor or just processor, is the electronic circuitry that executes instructions comprising a computer program. The CPU performs basic arithmetic, logic, controlling, and ...
resources at a fixed cost (the price of the
proprietary software Proprietary software is computer software, software that is deemed within the free and open-source software to be non-free because its creator, publisher, or other rightsholder or rightsholder partner exercises a legal monopoly afforded by modern ...
). 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 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

Some binary optimizers do
executable compression Executable compression is any means of data compression, compressing an executable file and combining the compressed data with decompression code into a single executable. When this compressed executable is executed, the decompression code recre ...
, which reduces the ''size'' of binary files using generic
data compression In information theory, data compression, source coding, or bit-rate reduction is the process of encoding information using fewer bits than the original representation. Any particular compression is either lossy or lossless. Lossless compressi ...
techniques, reducing storage requirements and transfer and loading times, but not improving run-time performance. Actual consolidation of duplicate library modules would also reduce memory requirements. Some binary optimizers utilize run-time metrics ( profiling) to introspectively improve performance using techniques similar to JIT compilers.


Recent developments

More recently developed 'binary optimizers' for various platforms, some claiming
novelty Novelty (derived from Latin word ''novus'' for "new") is the quality of being new, or following from that, of being striking, original or unusual. Novelty may be the shared experience of a new cultural phenomenon or the subjective perception of an ...
but, nevertheless, essentially using the same (or similar) techniques described above, include: * IBM Automatic Binary Optimizer for z/OS (ABO) (2015) * IBM Automatic Binary Optimizer for z/OS (ABO) Trial Cloud Service (2020) * The Sun Studio Binary Code Optimizer — which requires a profile phase beforehand * Design and Engineering of a Dynamic Binary Optimizer — from IBM T. J. Watson Res. Center (February 2005) * QuaC: Binary Optimization for Fast Runtime Code Generation in C — (which appears to include some elements of JIT) * DynamoRIO * COBRA: An Adaptive Runtime Binary Optimization Framework for Multithreaded Applications * Spike Executable Optimizer (Unix kernel) * "SOLAR" Software Optimization at Link-time And Run-time * Dynimize: CPU Performance Virtualization * BOLT: post-link optimizer built on top of the
LLVM LLVM is a set of compiler and toolchain technologies that can be used to develop a front end for any programming language and a back end for any instruction set architecture. LLVM is designed around a language-independent intermediate repre ...
framework. Utilizing sample-based profiling, BOLT improves the performance of real-world applications even for highly optimized binaries built with both Feedback Directed Optimization and Link-time optimization. For GCC and
Clang Clang is a compiler front end for the C, C++, Objective-C, and Objective-C++ programming languages, as well as the OpenMP, OpenCL, RenderScript, CUDA, and HIP frameworks. It acts as a drop-in replacement for the GNU Compiler Collection ...
compilers, BOLT speeds up their binaries by up to 20.4% on top of FDO and LTO, and up to 52.1% if the binaries are built without FDO and LTO.


See also

*
Binary recompilation A binary recompiler is a compiler that takes executable binary files as input, analyzes their structure, applies transformations and optimizations, and outputs new optimized executable binaries. The foundation to the concepts of binary recompila ...
* Binary translation * Dynamic dead code elimination


References

{{DEFAULTSORT:Object Code Optimizer Compiler optimizations Computer performance Software optimization