Gathering Runtime Statistics for Optimizing