In this study, an ignition engine is investigated by using three different codes for its management system to obtain the best performance. The effect of improved engine management system on the energy and exergy efficiencies is investigated. Two different tests in the idle (850 rpm-900 rpm) and mid-range (2,500 rpm) modes are conducted. According to the results, a reduction in the exhaust emissions can be obtained while the energy efficiencies increase 1.23% in both cases. Meanwhile, the exergy efficiency increases 4.76% and 0.7% in the idle speed and mid-ranges, respectively. The amount of unburned hydrocarbons, carbon monoxide, and NOx decrease 22.4%, 31%, and 1.4%, respectively, in the idle speed. Brake specific fuel consumption (BSFC) reduces 1.4% in idle speed and 1.2% in medium speed for the optimum mode in the experiments. The corresponding improved codes can be assumed as an optimal model for the considered engine.