A greedy algorithm slashes memory use in molecular simulation
Automated optimization of a molecular simulation program

In this personal account, Shishir Iyer describes how he and the Paesani Research Group at UC San Diego optimized MBX, a molecular simulation package. They vectorized a three-body water polynomial with SIMD instructions, but the speedup was limited by memory demands. By introducing the concept of 'livesize' and applying redundant subexpression removal and statement reordering, they reduced the maximum livesize by over 20% in the first pass, bringing the program's memory usage closer to the theoretical minimum.
The redundant subexpression removal was able to significantly reduce the livesize, with over a 20% reduction in maximum livesize from the first pass alone.