Binary optimization
   HOME

TheInfoList



OR:

An object code optimizer, sometimes also known as a post pass optimizer or, for small sections of code, peephole optimizer, 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 fil ...
- 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 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 mod ...
mainframes without the need for recompiling source. It uses advanced optimization technology shipped in the latest Enterprise COBOL. ABO optimizes compiled
binaries 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 fil ...
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 In computing, a compiler is a computer program that translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primarily used for programs that ...
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 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 Capex Corporation was an American computer software company in existence from 1969 through 1982 and based in Phoenix, Arizona. It made a variety of software products, mostly system utilities for the IBM mainframe platform, and was known for its Op ...
in the mid 1970s for COBOL. 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 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 ...
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 In compiler construction, 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 loo ...
. For example, on the
IBM/360 The IBM System/360 (S/360) is a family of mainframe computer systems that was announced by IBM on April 7, 1964, and delivered between 1965 and 1978. It was the first family of computers designed to cover both commercial and scientific applic ...
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 computing, a compiler is a computer program that translates computer code written in one programming language (the ''source'' language) into another language (the ...
) could be improved almost instantly with minimal effort, reducing CPU resources at a fixed cost (the price of the
proprietary software Proprietary software is 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 copyright and i ...
). 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
upgrade Upgrading is the process of replacing a product with a newer version of the same product. In computing and consumer electronics an upgrade is generally a replacement of hardware, software or firmware with a newer or better version, in order to ...
s, 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 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 recreates the origina ...
, 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 compressio ...
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 Jit (also known as jiti, jit-jive and the Harare beat) is a style of popular Zimbabwean dance music. It features a swift rhythm played on drums and accompanied by a guitar. Jit evolved out many diverse influences, including domestic chimurenga, ...
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 ''The'' () is a grammatical article in English, denoting persons or things already mentioned, under discussion, implied or otherwise presumed familiar to listeners, readers, or speakers. It is the definite article in English. ''The'' is the m ...
— which requires a
profile Profile or profiles may refer to: Art, entertainment and media Music * ''Profile'' (Jan Akkerman album), 1973 * ''Profile'' (Githead album), 2005 * ''Profile'' (Pat Donohue album), 2005 * ''Profile'' (Duke Pearson album), 1959 * '' ''Profi ...
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 computer science, self-modifying code (SMC) is code that alters its own instructions while it is executing – usually to reduce the instruction path length and improve performance or simply to reduce otherwise repetitively similar code, ...
in C — (which appears to include some elements of JIT) *
DynamoRIO DynamoRIO is a BSD licensed dynamic binary instrumentation framework for the development of dynamic program analysis tools. DynamoRIO targets user space applications under the Android, Linux, and Windows operating systems running on the AArch3 ...
* 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 Profile-guided optimization (PGO, sometimes pronounced as ''pogo''), also known as profile-directed feedback (PDF), and feedback-directed optimization (FDO) is a compiler optimization technique in computer programming that uses profiling to impr ...
and
Link-time optimization Interprocedural optimization (IPO) is a collection of compiler techniques used in computer programming to improve performance in programs containing many frequently used functions of small or medium length. IPO differs from other compiler optimiz ...
. 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 * Binary translation * Dynamic dead code elimination


References

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