
A binary optimizer, also known as an object code optimizer, takes a program's object code or machine code either from a linked executable binary file, or from live program memory, and produces sections of optimized code, invoked through either redirection or code replacement, that is functionally equivalent yet more performant. Program speedup is a common optimization goal. Some are intended to modernize old binaries to take better advantage of updated hardware, while others lean heavily on profile-guided optimization and interprocedural optimization to deliver performance gains. Some utilize run-time mechanisms to introspectively improve performance using techniques similar to JIT compilers.
CLI instruction was, depending on the particular model, between twice and five times as fast as a CLC instruction for single byte comparisons.
Some binary optimizers allow for the application of better compiler optimizations to executables where source code is not available, in some cases instantly with minimal effort. They may allow for more accurate profile attribution when profile guided optimizations are applied. Whole program optimizations can be applied to finished executables, beyond the scope of traditional source code compilation units. Dynamic binary optimization allows for more accurate, flexible profiling information, specializing shared library code per process, and may not require changes to binaries on disk.