4

Code Optimization Techniques in Compiler Design

 1 year ago
source link: https://www.geeksforgeeks.org/videos/code-optimization-techniques-in-compiler-design/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Code Optimization Techniques in Compiler Design

Code Optimization Techniques in Compiler Design
  • 10 Views
  • 21/10/2022

Optimizing any code or algorithm plays an important role in enhancing its performance in terms of decreasing time complexity, space complexity, etc. It might involve decreasing the code’s size up to much extent. So, it can be said that optimization helps in reducing the resources and space consumed, thus increasing the compilation speed.

Performing code optimization manually involves much time and the process is tedious too. So, it’s better to use a code optimizer for the same. An optimized code promotes the reusability of code. 

The code optimization procedure can be classified into two types:

Machine Independent Optimization: This optimization phase improves the intermediate code for getting better target code in output. This intermediate code doesn’t involve, in general, any CPU registers or absolute memory locations.

Machine Dependent Optimization: It is done after the generation of the target code. It generally involves CPU registers as well as absolute memory references. Such optimizers try to take maximum advantage of the memory hierarchy.

Different ways of code optimization:


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK