title: Are there any examples of applying machine learning to improve code performance?
body: <p>I saw a <a href="http://www.infoq.com/presentations/facebook-tuning" rel="nofollow">talk</a> by Keith Adams of Facebook comparing machine learning techniques to tuning code for improved performance in the real world. Are there examples of such automation techniques being applied in real projects? I </p>
  
  <p>I know of profile guided optimizations in certain compilers and also some techniques JIT compilers use to improve performance, but I am thinking of more fundamental ways to improve code performance that could require changing the code itself and not code generation. Things like:</p>
  
  <ol>
  <li>Choosing the optimal buffer size in a particular network application or choosing the right stack size for particular application.</li>
  <li>Selecting the struct layout in a multi-threaded application that improves local cache performance while reducing false sharing.</li>
  <li>Selecting different data structures all together for a certain algorithm.</li>
  </ol>
  
  <p>I read a <a href="http://people.csail.mit.edu/jrk/halide-pldi13.pdf" rel="nofollow">paper</a> on Halide, an image processing framework that uses genetic algorithms to auto-tune image processing pipelines to improve performance. Examples like this one or any pointers to research would be useful.</p>