1. A control system including an execution environment of control software that analyzes a control program and executes processing for outputting control information on a machine as a control object, the control system comprising: a control program reception unit that receives the control program and a use history of the control program; a use frequency calculation unit that calculates a use frequency of a function used by the control program based on the control program, or on the control program and the use history of the control program; a source code optimization unit that optimizes a source code of the control software to generate an optimized source code based on the use frequency of the function used by the control program that is calculated by the use frequency calculation unit; a control software generation unit that generates optimized control software based on the optimized source code; and a control software transfer unit that transfers the optimized control software to the execution environment of the control software.