Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

ISRO | ISRO CS 2016 | Question 41

  • Last Updated : 07 Oct, 2020

Peephole optimization is form of
(A) Loop optimization
(B) Local optimization
(C) Constant folding
(D) Data flow analysis

Answer: (B)

Explanation: In the optimisation technique, we optimise the code during compilation which reduces the space complexity as well as time complexity and eliminate the redundant code.Peephole optimization one of the optimisation technique which performed on a small set of compiler-generated instructions and the small set is known as the peephole or window. Peephole optimization does change the small set of instructions to the other an equivalent set which has better performance.:-

For example :-

  1. Peephole optimization technique would remove both instructions push and pop operation on stack instead of pushing register A onto the stack and then immediately popping the value back into register A
  2. Peephole optimization technique might do an arithmetic shift left Instead of adding A to A.
  3. Peephole optimization technique might scale the floating point register’s exponent by 3 Instead of multiplying a floating point register by 8.

The main objective of peephole optimization is:

  • To improve performance
  • To reduce memory footprint
  • To reduce code size

Option (B) is correct.

Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!