With the increase of the complexity of practical problems, the optimization of sparse linear equations becomes more and more important. Based on two kinds of solutions of linear equations: direct solution and iterative solution, this paper probes into the solutions of sparse matrix equations. For the direct solution, the Gauss elimination method without selecting pivot elements, column selecting pivot elements, and all selecting pivot elements is selected to explore the performance of sparse matrix solution for triplet storage. For the iterative method, we select the GMRES method and explore three methods including general GMRES, GMRES with LU pretreatment, and GMRES with LU pretreatment and restart. Finally, we compare and analyze the performance differences of all the above direct and iterative solutions, and find that the GMRES method restarted after incomplete LU decomposition can be used as a better general solution of general linear sparse matrix equations. At the same time, the applicable matrices of various methods and their shortcomings are given.