diff --git a/files/optimize.jpeg b/files/optimize.jpeg new file mode 100644 index 00000000..f1caf958 Binary files /dev/null and b/files/optimize.jpeg differ diff --git a/practices/optimizations.md b/practices/optimizations.md new file mode 100644 index 00000000..674ab032 --- /dev/null +++ b/practices/optimizations.md @@ -0,0 +1,60 @@ +--- +slug: optimizations +stages: + - development +short_description: Optimization is the process of modifying a software system to make some aspect of it work more efficiently or use fewer resources +tags: + - optimizations + - code coverage +keywords: + - code - quality + - merge + - testing + - codebase +--- + +# Optimizations + +**TL;DR** + +Optimization is an process or methodolgy that is used to make something(for instance any program) to run faster(making it effective) while fulfilling its functionality normally. + + +## What Is an Optimization +The code optimization in the synthesis phase is a program transformation technique,in which the intermediate code is tend to be improved and thus will be consuming fewer resources (i.e. CPU, Memory), hence faster-running machine code will result. + +![Optimization](/files/optimize.jpeg) + [Spconinc.com](https://www.spconinc.com/cerner-millennium-implementation-optimization-support/) + + +## Why You Might Want the Optimization + +Optimization overall helps to achieve the same goal with lower consumption of resources hence this practice should be followed. +So optimization helps to: + +- High compilation speed and low consumption of space. +- Code optimizers are used to avoid overburn of manual optimization as it involves a lot of time. +- Re-usability can be achieved while following optimization. + +## How to Implement the Optimization +1. **Optimize your Code using Appropriate Algorithm** +2. **Optimize Your Code for Memory** +4. **Using Operators** : Most basic operations like +=, -=, and *=, when applied on basic data types could slow down the program as well. +5. **Problems with Functions** : For example, if you have a code like this, it might be a bad thing. +``` +for(int i=1; i<=10; ++i) + DoSomething(i); +``` +6. **Optimizing Loops** +7. **Data Structure Optimization** + +## Common Pitfalls of the Optimization + +- Bigger code base is the major problem faced due to time based optimizations. +- Chances to improve and make code run faster never ends hence making Performance optimization a never-ending process. +- Coding standards are compromised sometimes to achieve optimization. + +## Resources for the Optimization +- Wikipedia: [Program Optimizations](https://en.wikipedia.org/wiki/Program_optimization) +- Einfochips: [ Goals of Optimization](https://www.einfochips.com/wp-content/uploads/resources/a-practical-approach-to-optimize-code-implementation.pdf) +- The Geek Stuff: [ Optimization Tips](https://www.thegeekstuff.com/2015/01/c-cpp-code-optimization/)