The locomotion of fish provides insight for the design of efficient swimming robotic devices. The current study presents a systematic investigation of the locomotion performance of a fish-like swimmer with a wide range of parameter settings. Two-dimensional simulations with the immersed boundary method in the framework of Navier–Stokes equations are employed for the fluid–structure interaction analysis. Unlike most previous studies where the kinematics of the swimmer is predetermined, the locomotion of the current swimmer is the response of a single periodic torque applied to the anterior part. In addition, current simulations applied a direct correspondence between code units and real-world units, providing more engineering-related guidance for the future design of microrobotic swimmers. The effect of the distribution of body stiffness on swimming performance and propulsion generation is discussed with different pitch frequencies and amplitudes. It was shown that swimmers with a more flexible posterior part have an advantage in undulatory swimming performance when the pitch angle is low or moderate. However, such an advantage disappears when the pitch angle or actuating frequency exceed a certain level. An analysis of the phase-averaged vorticity field and thrust sequence is given to clarify the change in performance due to the variation of flexibility.