OCA (Optimizing Code Advisor) is a development tool in the form of an Eclipse plugin that displays recommendations about potential optimizations, parallelization or hazards directly on your source code.
The recommendations are accompanied by an estimated profile information and include optimizations that cannot always be applied by a compiler due to missing aliasing information.
These recommendations are generated from a source-code analysis applied in the Eclipse IDE and once such recommendation is ready it is displayed to the user in the Ecplise interface along with an example on how to refactor the code.
The tool is very useful for developers who would like to improve the performance of their application, or in the case where it is not possible to apply strong compiler optimizations due to debuggability and support concerns.
OCA is independent of the compiler, the operating-system or the CPU, thus providing flexibility to operate on vast project enviroments. As such, OCA also provides comments on code that does not yet run or does pass full compilation. Simply modify your code and re-apply the OCA plugin button to re-generate the comments while you are developing.
The Optimizing Code Advisor includes the following main capabilities:
- Estimated Frequency Analyzer (EFDAnalyzer):
- A static estimating profiler (currently supported only for JAVA sources).
- C/C++ Optimizing Code Advisor (C-OCA) and Java Optimizing Code Advisor (J-OCA), containing the following optimization tips:
- Loop parallelization
- Loop distribution
- Advanced Function Specialization
- Implicit casting
- Dead code elimination
- Constant propagation
- Copy propagation
- Strength reduction
- Algebraic simplification
- Class inlining
- Loop Invariant code
- Call by value
- and more.
General display of comments in Eclipse:
Straight Parallelizable Loop (loop with potentially no cross iterations dependent statements):
Simple Parallelizable Loop (parallelizaton after defining and initializing auxiliary arrays):
Parallelization after Loop Distribution:
Parallelizable Reduction Loop:
The C/C++ Optimizing Code Advisor (C-OCA), the JAVA Optimizing Code Advisor (J-OCA) and the Estimated Performance Frequency Analyzer (EFDAnalyzer) are a set of plug-ins for Eclipse CDT/JDT IDEs, combined in one package. Current version of OCA plug-ins are tested on Eclipse Kepler release. To download Eclipse follow the instructions in the link:
Once Eclipse is downloaded and installed, start it and then go to "Help" -> "Install New Software". Make sure that the check box "Hide items that are already installed" is NOT checked and press the "Add" button. In the "Location" text box type the URL: http://www.optca.org/UpdateSite/. Then, select "Optimizing Code Advisor" and continue with the installation.
For immediate evaluation and usage of OCA, a full Eclipse Kepler including OCA plug-in with input examples, can be downloaded directly from the links below:
Upon next start of Eclipse, OCA icon and menu will be added to the toolbar and ready for use by selecting a specific optimization from the drop-down menu.
For OCA to analyze all project source files, all sources directories need to be configured: Go to Project->Properties->C/C++ General->Paths and Symbols->Source Location and add all relevant sources directories.
Gadi Haber: email@example.com
Cfir Aguston: firstname.lastname@example.org
- Static Profile guided comments for C-OCA - similar to the J-OCA EFD - Estimated Frequency Degree plugin for Java code.
- Smart Comments containing proposed optimized code.
- Advanced new parallelization coments using Thread Level Speculation.
OCA - Optimizing Code Advisor
- CATC 2016 - Compilers, Architecture and Tools Conference, Haifa, Israel, September 15. Presentation foils
- ISCA 2013 Tutorial on Analysis Methodologies and Tools, Tel-Aviv, Israel, June 23. Tutorial foils
- CATC 2013 - Compilers, Architecture and Tools Conference, Haifa, Israel, Nov. 18 - 19. Poster file