Phase unwrapping is a key issue in InSAR research. As a critical step of InSAR processing, it affects the accuracy of interferometry measurement directly. The efficiency of the traditional quality-guided phase unwrapping method is low due to a great deal of sorting, espceically for large interferogram. This paper proposes a highly efficient quality-guided phase unwrapping method based on heap sort in order to solve the problem. First, the quality map is caculated according to the interferometric complex data or interferogram. Next, with the max-heap acting as the data structure of sorting, its property is maintained while deleting root node and inserting new node, and thus the sorting of quality map is accomplished and the phase can be unwrapped from high quality areas to low quality areas. The improved algorithm reduces the computational complexity greatly compared with traditional methods, which is significant in large area mapping of InSAR. At the end of the paper, the simulated and experimental results show the accuracy and the efficiency of the algorithm.