BrainDump
  Home arrow BrainDump arrow Low-Level Code Optimization in Phoenix
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
BRAINDUMP

Low-Level Code Optimization in Phoenix
By: Gabor Bernat
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2009-03-11

    Table of Contents:
  • Low-Level Code Optimization in Phoenix
  • Resource allocation
  • The optimization checkpoints
  • Levels of the IR and producing plug-ins

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Low-Level Code Optimization in Phoenix


    (Page 1 of 4 )

    Compiler writing has been reduced to the job of a few people in the past. The developer should stop worrying about the phase at which the code snippet he entered in becomes code that the machine can execute. The appearance of the Phoenix Compiler Framework may make things easier for those who wish to take advantage of it.

    I already presented the framework in a nutshell, so this week I will not cover this section again. If you missed my article titled "The Phoenix Compiler Framework," you are free to read it, just search the ASP Free site, or even better, under my profile. Everything I presented there will come in handy for a better understanding of this article, although you do not have to read it first. 

    Writing code has always been built around the developer. There always has been a direction to make the life of the developer easier. For this purpose, languages appeared that we call "managed," and for this reason, tools exist that help us develop, such as Microsoft Visual Studio or Netbeans.

    Of course you can write a great program with just a text editor; however, at some point, that can become so complicated that the developer will "break his legs" in the code, and he will have enough of everything related to coding for a lifetime.

    No one wants this to happen. Therefore, specific tools were created to compensate for algorithmic problems with ease of implementation. However, at the end of the day, the code written by a developer will have to be transformed into something that the machine can understand and run.

    Nice, readable code will have little importance for the machine. It executes anything without checking its appearance. Moreover, the saddest thing is that the most optimal and fastest codes still are the ones that are hard to read and write. To make the best trade with the developer, the ideal case scenario is to transform your beautiful code into fast code.

    By the end of the previous article about Phoenix, you realized the importance of the linear flow of the IR (Intermediate Representation). This is what a back=end programmer of Phoenix will have, and this is what he has to generate.

    The front-end is responsible for checking that what you wrote is valid according to the language's semantics and enforce those rules on you. This includes jobs like making sure you do make every cast correct, or even that you made it at all, or that you have not missed a ";" somewhere.

    So for this part, we are going to the back end of the compiler to see how your code snippet is going to become executable machine code. One of the people responsible for this job for the Phoenix Compiler is Russell Hadley. The code that he gets from the front-end looks just like your programming teacher at the university told you not to write it.

    It is full of labels and "goto"s. It may include a sequence of instructions that says add this with this, flip this bit, check if this variable is zero and if so go to there. Russell is responsible for filtering the code in a manner that, in the end, will make it both efficient and understandable to the platform.

    More BrainDump Articles
    More By Gabor Bernat


     

    BRAINDUMP ARTICLES

    - Introduction to Office Live Workspace
    - Using MS Excel for One-way Analysis of Varia...
    - Comparing Data Sets Using Statistical Analys...
    - Import Blogger Posts into WordPress Using Wi...
    - Download WordPress from an FTP Server and Ru...
    - Install and Run WordPress in XAMPP Local Host
    - What Windows 7 Brings to the Table
    - Virtualization and Sandbox Detection
    - Advanced Firebug Techniques in Windows XP Ho...
    - Editing CSS with Firebug in Windows XP Home
    - Using Firebug in Windows XP Home
    - Migrating to Exchange Server 2007
    - Using System Restore on a Non-Bootable PC
    - Finding Logged on Users and More Scripting S...
    - Developing Macro Commands in MS Excel





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek