A method for iteratively autotuning a high-performance computing system that depends on a set of parameters. Performance is first evaluated two or more times with the current values of the parameters. Afterward at least two evaluations, the median performance is evaluated. The median is then tested against a rule based on a filtering threshold. If the median does not the rule, the current values of the parameters are discarded, and the method is restarted with at least one other value generated by an optimization module; otherwise, a resampling method is performed based on the median and on a confidence interval that decreases with the number of steps of the optimization method.