The complexity of the electric machine structure makes an optimal design a difficult and challenging task. Particle Swarm Optimization (PSO) and Genetic Algorithm (GA) are two popular methods for their advantages such as gradient-free and ability to find global optima. Due to the fact that the machine design models are sometimes computationally intense, it is important for the optimization algorithms used in the design practice to have high computational efficiency. This paper uses the design of a Surface Mount Permanent Magnet (SMPM) machine with an analytical model as a benchmark and compares the performance of PSO and GA in terms of their accuracy, the robustness to population size and algorithm coefficients. The results show that PSO has advantages over GA on those aspects and is preferred over GA when time is a limiting factor. Similarities in the machine design problems make the comparison result also applicable to the design of other types of machines and with other modeling methods.