This document presents an online efficiency optimization method for an interior permanent magnet synchronous motor (IPMSM) drive system in an electric vehicle. A finite element analysis is used to build an accurate machine model that considers magnetic saturation, spatial harmonics, and iron loss effects. The proposed method calculates the total system losses, including fundamental copper and iron losses, harmonic copper and iron losses, magnet loss, and inverter losses. An online algorithm is developed to determine the optimal current angle for maximum efficiency per ampere control over the entire speed range. Simulation results demonstrate the superior performance of the proposed online method over conventional offline efficiency optimization techniques.