Preview

CompilerOptimization

Satisfactory Essays
Open Document
Open Document
545 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
CompilerOptimization
Presentation on

Compiler Design
By Sandeep Negi

Introduction
What optimization is?
Optimization at different levels.
Pareto principle & Hotspots
When to Optimize?
Automated and Manual Optimization
Classification of optimization technique
Optimizing Transformations

What Optimization is?

Definition:It is process of modifying a software system to make some aspect of it work more efficiently or use fewer resources. Main aim is to find superior algorithm.

Optimization of a code to add n numbers
Things we should take care during optimization
Factors influencing optimization

Optimization at different levels Few Terms to know
1.
2.
3.
4.

Algorithm
Algorithmic efficiency
Compiler optimization
JIT – Just in time compiler

Optimization can be done in almost all phases of
Compilation - diagram
1.
2.
3.
4.
5.

Design Level
Source Code Level
Compiler Level
Assembly Level
Run Time Level

Pareto Principle & Hotspots

Pareto Principle:20% of the code is responsible for 80% of the results.
90/10 Law in Software Engineering.

Hotspot
Region of a computer program where a high proportion of executed instructions occur.
In general loops are hot spot.

When to Optimize?

Donald Knuth Statement:"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil".

Premature Optimization
Phrase used to describe a situation where a programmer lets performance considerations affects the design of a piece of code

Automated & Manual
Optimization

Automatic Optimization
1.
2.
3.
4.
5.
6.

Can’t optimize whole system
Easy
Cost effective
Fast
Pre defined and Tested
Will not effect the algorithm

Manual Optimization
Slow
Costly
Very effective
Produce efficient code
More chances of bug creation
IQ

Classification of Optimization
Technique

Optimization Techniques
1.
2.
3.
4.

Peephole optimization
Local optimizations
Global Optimizations
Loop optimization

Objectives
1. Avoid redundancy: something already computed need not be

You May Also Find These Documents Helpful

  • Good Essays

    Pt2520 Unit 3 Metrics

    • 544 Words
    • 3 Pages

    In large software products, a measure is a number of functions used. Some studies showed that some programmer uses the same number of functions to solve given a problem. Another important part of the software is data processed. To understand the psychological complexity of software understanding the amount of data processed by the software is important. VARS is the count of all user defined is the variables used during program development. The average number of variables is the sum of the count of live variables divided by executable statement count. The span defines how many times the variable is used. Based on modules sharing data there are two software measurement types Fan-in which gives the number of modules pass data either indirectly or directly. Whereas Fan-out gives the number of modules to which data passed indirectly or directly. There also another measure which is called as decision count which gives the number of decision statement used in the program. Paths are also used to count the number of different ways the program can be…

    • 544 Words
    • 3 Pages
    Good Essays
  • Powerful Essays

    En1320 Unit 1 Research Paper 1

    • 27742 Words
    • 111 Pages

    is extensively discussed in other works and is not the focus of this guide. The second…

    • 27742 Words
    • 111 Pages
    Powerful Essays
  • Satisfactory Essays

    Amsco Answer Key

    • 523 Words
    • 3 Pages

    2. 3. 4. 5. 6.…

    • 523 Words
    • 3 Pages
    Satisfactory Essays
  • Powerful Essays

    Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9 Chapter 10 Chapter 11 Chapter 12 Chapter 13 Chapter 14 Chapter 15 Chapter 16 Chapter 17 Chapter 18 Chapter 19 Chapter 20 Chapter 21 Chapter 22 Chapter 23 Chapter 24 Chapter 25 Chapter 26 Chapter 27 An Introduction to Hardware, Software, and the Internet An Introduction to Software Development Objects and Classes Algorithms Java Syntax and Style Data Types, Variables, and Arithmetic Boolean Expressions and if-else Statements Iterative Statements: while, for, do–while Implementing Classes and Using Objects Strings Class Hierarchies and Interfaces Arrays…

    • 3908 Words
    • 16 Pages
    Powerful Essays
  • Good Essays

    CH01ProblemsCasespg453 455

    • 1827 Words
    • 8 Pages

    Additional Problems and Cases Chapter 1 Extra Problems/Cases 41. What is the difference between a parameter and a decision variable in a mathematical model? 42. Discuss how a spreadsheet can facilitate the development of a model shell and the model itself. 43.…

    • 1827 Words
    • 8 Pages
    Good Essays
  • Satisfactory Essays

    This article focuses a lot on the output of the rewriting activity, inspecting the rewritten HPC programs and causes of source-code bloat. “A key metric was the number of SLOC (source lines of code).” The use of source code, uncovers various indications that the rewritten programs had fewer lines of code, and also that they were easier to read, verify, and modify. The new code is clear, concise, and easy to read. Readability and maintainability of the source code benefited greatly from condensing these transformations into a few functions, but the performance suffered from the extra procedure calls and loss of many specializations and optimizations of the transformations. The battle to deliver good performance on expressive HPC source code must still…

    • 630 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Exam 2: Pre-Test Questions

    • 4437 Words
    • 18 Pages

    1. The use of predetermined overhead rates in a job-order cost system makes it possible to estimate the total cost of a given job as soon as production is completed.…

    • 4437 Words
    • 18 Pages
    Satisfactory Essays
  • Better Essays

    three objectives. One of the challenges when adapting a multiobjective technique to a software engineering problem is how to…

    • 5164 Words
    • 21 Pages
    Better Essays
  • Good Essays

    Many researchers have been done but the current research focus has led to the invention of many optimization issues and finding of many new solution approaches. In broad sense, Optimization issues basically include logistics, disease diagnosis, and preventive care of patients, service planning and resource scheduling.…

    • 523 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Based on the Lenning (2005), article and reading from the Microsoft web site a user should accept the primary security that is placed on the user’s computer by Microsoft. The security’s purpose is to protect the computer’s hardware as well as the data saved to the computer. Unknown macros downloaded by the user may cause the Microsoft security system to think it has a virus. The user must be cautious when choosing whether to use a signed or unsigned macro. Many unsigned macros are automatically disabled. (Microsoft, 2002). It is important to educate users of these risks once their dilemma is resolved. The continued alerts sent by the Microsoft security system to Microsoft itself will educate the user and the program as to whether or not a macro is a virus or not. Another reason it is important is because the user might be receiving alerts that there are viruses or some sort of security issue to the user’s computer. The worst type of macros is an actual virus and this virus may not be recognized by a security program. Macros may also unintentionally delete data or information the user saved on the computer and could be deleted by the computer for no apparent reason.…

    • 325 Words
    • 2 Pages
    Good Essays
  • Powerful Essays

    SOFT WARE DEVELOPMENT

    • 1837 Words
    • 8 Pages

    AV8R Fantasy Flights is an aeroplane time-share charter business based at Airlie Beach, on Queensland’s Whitsunday coast.…

    • 1837 Words
    • 8 Pages
    Powerful Essays
  • Powerful Essays

    One particular tool that offers a solution is StackX from Express Logic, Inc. On their…

    • 3030 Words
    • 13 Pages
    Powerful Essays
  • Powerful Essays

    Software costs often dominate computer system costs. The costs of software on a PC are often greater than the hardware cost. Software costs more to maintain than it does to develop. For systems with a long life, maintenance costs may be several times development costs. Software engineering is concerned with costeffective software development.…

    • 3029 Words
    • 13 Pages
    Powerful Essays
  • Good Essays

    Incremental Development

    • 481 Words
    • 2 Pages

    The product is decomposed into a number of components, each of which is designed and built separately (termed as builds). Each component is delivered to the client when it is complete. This allows partial utilization of the product and avoids a long development time. It also avoids a large initial capital outlay and subsequent long waiting period. This model of development also helps ease the traumatic effect of introducing a completely new system all at once. There are, however, several problems with this model.…

    • 481 Words
    • 2 Pages
    Good Essays
  • Better Essays

    The prototype was developed under the Microsoft technologies stack. However, since I only have Apple computers at home I had to make use of the free VirtualBox solution. Gratefully, as a UH student, I was able to download Windows 7 Professional with Service Pack 1 64-bit and Visual Studio Community 2015 with Update 2 64-bit for free from the Dreamspark site.…

    • 1442 Words
    • 6 Pages
    Better Essays