The acceleration and deceleration time is usually a constant value in the process of computer numerical control (CNC) machine tool processing, which cannot adapt to the change of external load and greatly affects processing efficiency. This paper proposes an optimization method for the acceleration and deceleration time of the feed system based on load inertia, which provides the basis for the adaptive adjustment of the acceleration and deceleration time of the feed system. Firstly, by establishing the dynamic model of the servo system, the acceleration and deceleration method is used to identify the external load inertia under different working conditions. The prediction model of the current variance based on load inertia and acceleration and deceleration time parameters is established by using the response surface method, and then the multi-objective particle swarm optimization algorithm is used to build the acceleration and deceleration time optimization model based on the load inertia. At the same time, the inertia identification part is compared with the model reference adaptive system method and the empirical formula estimation method based on current and velocity, the simulation and cutting experiment results show that the inertia identification method based on acceleration and deceleration optimizes the other method. Finally, the machining experiments are carried out on three-axis and five-axis machine tools with the same machine tool type, and by adding different counterweight blocks to change the external load. The test proves that the acceleration and deceleration adaptive adjustment strategy based on load inertia can effectively improve processing efficiency and reduce the fluctuation of the processing load.