It's a complex process -- and there are plenty of research papers available if you want to delve deeper -- but in a nutshell, it works by analyzing the source code input to find specific "features" that might be good candidates for optimization. In this context, features might include such traits as the number of subroutines in the code that take a lot of parameters, whether there are a lot of nested loops, or which types of math the program uses most often. Once MilePost has built a catalog of all the features present in a given program, it can use statistical techniques to decide which optimizations will yield the best results and readjust its own modular design as appropriate.
This isn't so different from what human compiler developers have been doing for years, but for humans the process is much more arbitrary. Often the best they can do is to guess which optimizations will be desirable the most often. MilePost has the advantage of basing its decisions on statistical data gathered from real-world use cases in specific environments. Initial tests by IBM have shown that MilePost can improve performance by as much as 18 percent versus the code output by traditional compilers.
In addition, the MilePost project has since spawned the Collective Tuning Initiative, a Web-based collaboration effort with a goal of accumulating still more information that can be applied to improve self-modifying compilers, such as MilePost.
It's about more than just speed
It's fair to ask how important this kind of low-level optimization really is, when processors seem to be gaining speed by leaps and bounds each year. Most users probably don't use half the processor power of their PCs already. But while that may be true on the desktop, it's a different story in the world of mobile devices. When targeting devices with low-powered processors and limited resources, code optimization isn't an option -- it's essential.
Developers of software for handhelds often target several platforms at once. Achieving equivalent performance on each platform can require extensive optimization, and if no mature optimizing compilers exist, that optimization has to be done by hand. This process might take months, adding considerable overhead to the development budget and delaying time to market. But a machine-learning compiler that adapts to each platform individually could eliminate much of this drudgework, slashing development costs in the process.