Mobile edge computing technology has a wide range of applications in enhancing the capability of wireless network devices in the construction of smart cities, which is the core driving force in the construction of smart cities. In this paper, the IRS auxiliary channel model, one of the key technologies in 5G networks, is combined into the design of mobile edge computing system, and the optimization model of mobile edge computing system is proposed in the light of the basic requirements in the construction of smart cities. The alternating iteration algorithm is used to decompose the optimized model to obtain the sub-optimization model, and the particle swarm optimization algorithm is used to solve the sub-optimization model, and the performance-optimized 5G network-based mobile edge computing system is constructed. The results show that under the 10Mbit computing task volume, the latency of this paper’s system (M=2) is reduced by about 63.81% (2.148s) compared with that of the local computing-only scheme (5.935s), and good convergence performance can be guaranteed. It is also found that the application platform based on this system can guarantee fairness among users and can satisfy their respective performance requirements when used by multiple users. The mobile edge computing optimization method proposed in this paper has low-latency performance, which provides a strong technical guarantee for the construction and development of smart cities, and lays a foundation for improving the management efficiency and service level of cities.