In this paper we describe the application of optimization techniques to the design of valvetrains in high revving internal combustion engines. The methods presented are based on parameter optimization  and the minimum principle by Pontrjagin  and will be applied to cam lobe and valve spring optimization, aiming at reducing oscillation amplitudes and improving control of the valvetrain over a broad speed range.To put the task of optimization into context the engineering requirements for valvetrains and methods to allow their computer based analysis are described. Furthermore principle considerations for valve event curve generation and parametrization, and on optimization techniques are discussed. Based on these fundamentals, optimization aims and constraints are formulated. Furthermore different examples of the application of automated optimization are presented in the area of cam profile optimization and valve spring optimization. The comparison with measurements for an optimized valve spring design, which shows a significant improvement against the base line, finally proves the validity of the presented findings.