To satisfy the requirements for a pulsed space traveling-wave tube, including high efficiency, high reliability, and miniaturization, its thermal and mechanical performance must be optimized. In this paper, an electron gun is optimized using ANSYS software with double goal methods that take both thermal and mechanical factors into consideration. Experimental result shows that the heating power of the gun decreases from 10.5 to 8.2 W, its warm-up time is reduced from 320 to 200 s, and its total volume is cut down by 22%. In addition, the new gun shows good mechanical reliability. It is shown that the results of theory, computation, and experiment are in good agreement. Finally, further thermal optimization of the new gun is achieved by analyzing the radiant heat loss.