In this research, with the help of commercial software called AVL BOOST, the performance of the EF7 gasoline engine has been simulated numerically, and the effect of compression ratio and spark timing on power, torque, and thermal efficiency has been investigated. The error of the current modeling compared to the results of experimental tests was reported in the range of 3%. Also the simulation results showed that at high speed (5000 rpm) if the spark starts 25 degrees before the top dead point and the spark duration in the range is 55 degrees, the maximum output power is obtained from the engine, and as the spark duration increases, the ignition speed decreases and the output power decreases. Besides, with the greater advance of the ignition angle, a greater percentage of the input energy is lost as heat to the engine wall and the output power decreases. It is noteworthy that in the optimal CONDITIONS of spark timing at 5000 rpm, the thermal efficiency of about 38% can be achieved, which is increased by about 11% compared to the default spark timing mode.