The spatial layout and arrangement of obstacles in the built environment significantly affect its evacuation performance. However, few researchers focus on pedestrian simulation-based design optimization of built environment under emergency evacuation conditions. In this paper, we aim to evaluate the evacuation performance of optimized design solutions for traffic space in the teaching building of a primary school based on a pedestrian simulation approach and to quantify the effect of design parameters on evacuation time. Firstly, the level of traffic space design parameters was determined and optimized design solutions for the traffic space of the school building were generated. Secondly, based on the Anylogic simulation platform, the environment module and pedestrian evacuation behaviour rules of the teaching building were built to realize the evacuation behaviour simulation. Thirdly, the effect of the traffic space design parameters on the evacuation time of the teaching building was evaluated and the most significant design parameters were identified. Finally, the optimal combination of traffic space design parameters was proposed under evacuation performance orientation. The results show that the sensitivity of the traffic space design parameters to evacuation time is 31.85%. The effect of corridor width on evacuation time is 49.06 times greater than the staircase width. The optimal design combination for the traffic space in the teaching building of the primary school is a 3.0 m wide trapezoidal corridor combined with a 3.6 m wide staircase, and a 3.0 m wide fish maw corridor combined with 3.6 m wide staircase, guided by evacuation performance. The framework developed in this paper provides technical support for the development of evacuation performance-oriented design optimization of the built environment, and the results are intended to supplement the building design specifications.