官术网_书友最值得收藏!

  • Expert C++
  • Vardan Grigoryan Shunguang Wu
  • 94字
  • 2021-06-24 16:33:54

Optimization

Generating intermediate code helps the compiler to make optimizations in the code. Compilers try to optimize code a lot. Optimizations are done in more than one pass. For example, take the following code:

int a = 41; 
int b = a + 1;

This will be optimized into this during compilation: 

int a = 41; 
int b = 41 + 1;

This again will be optimized into the following: 

int a = 41; 
int b = 42;

Some programmers have no doubt that, nowadays, compilers code better than programmers. 

主站蜘蛛池模板: 长宁区| 磐石市| 望城县| 牡丹江市| 鞍山市| 白山市| 宜君县| 临洮县| 廊坊市| 饶河县| 察隅县| 囊谦县| 康乐县| 息烽县| 合山市| 通榆县| 乐都县| 清水县| 吴堡县| 从化市| 桐梓县| 大宁县| 贵港市| 云和县| 桐庐县| 家居| 富民县| 苏尼特右旗| 婺源县| 汉源县| 平罗县| 南开区| 滕州市| 公主岭市| 兰州市| 扶沟县| 同德县| 汝南县| 辰溪县| 五寨县| 湘潭县|