Browse Prior Art Database

smart code optimization

IP.com Disclosure Number: IPCOM000247571D
Publication Date: 2016-Sep-18
Document File: 4 page(s) / 19K

Publishing Venue

The IP.com Prior Art Database

Abstract

This disclosure describes a new method to optimize code execution efficiency from compilation and save loading effort of an program with too many conditions . Normally program efficiency is determined by code complexity that programmers should take care and how its compiler can be optimized. So far most of 3GL(third-generation language) have provided flexibility and lowered the "Get-Started" requirements to common users, therefore, they are designed as Nature Language which becomes more readable and easy to implement, but the fact is most of codes are not that efficient due to personal skill level. This idea intends to help users optimize the code in real time regardless of your source code, compiler and assembler.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 52% of the total text.

Page 01 of 4

smart code optimization

Program usually meets a situation of too many conditions blocks(e.g. if, switch, etc.). From an experienced expert's evaluation, nearly 5% of the codes running on mainframe are condition blocks. And what's frustrated is sometimes these condition blocks have the same judgement condition. They are just appearing in the different parts of the codes. So, it is wasting of time for a machine to do this repeated same judgement work.Can the same condition be

judged only at the point it first appears and eliminate the codes that do not under the cover of this condition in the followingcodes? That is the problem this disclosure aim to solve.

Currently, there is a method of optimization for the compiler--Profile Guided Optimization (PGO). It is a runtime compiler optimization which leverages profile data collected from running important and performance centric user scenarios to build an optimized version of the application. It is more like a black-box for us, but, as a programmer, who certainly knows which conditional variables are there, and wants to optimize them explicitly. Obviously, the PGO can not do this.

Assume we have the following program A ( PA), which has several parameters PAR1, PAR2, PAR3 etc. The PA will jump to different position depending on the parameters value. For example, we have 3 possible input for PAR1:value1, value2, value3, then the program looks like:

--------------------------- program start point ----------------------------------------

Int main(int argc, char* argv[]{ … other statement …

If ( PAR1 == value1 ){


… Some statement in CONDITION VALUE1 … …

}
… some other statement using STATEMENT BLOCK AAA to describe this part… If ( PAR1 == value2 ){


… Some statement in CONDITION VALUE2 … …

}
… some other statement using STATEMENT BLOCK BBB to describe this part … If ( PAR1 == value3 ){


… Some statement in CONDITION VALUE3 … …

}
… other statement using STATEMENT BLOCK CCC to describe this part …

//maybe after run a while other statement, the program will check the PAR1 settings again but do other things and maybe many times as below:

While(1){

If ( PAR1 == value1 ){

1



Page 02 of 4


… Some statement in CONDITION VALUE1 …

}
… some other statement using STATEMENT BLOCK DDD to describe this part … If ( PAR1 == value2 ){

… Some statement in CONDITION VALUE2 …

}
… some other statement using STATEMENT BLOCK EEE to describe this part … If ( PAR1 == value3 ){

… Some statement in CONDITION VALUE3 …

}
… other statement using STATEMENT BLOCK FFF to describe this part …

}
--------------------------- program end point ----------------------------------------

It will continue to do check for each loop to then decide which "...