Optimizing Performance of Automatic Training Phase for Application Performance Prediction in the Grid