Improving localization performance is one of the critical issues in Wireless Sensor Networks (WSN). As a range-free localization algorithm, Distance Vector-Hop(DV-Hop) is well-known for its simplicity but is hindered by its low accuracy and poor stability. Therefore, it is necessary to improve DV-Hop to achieve a competitive performance. However, the comprehensive performance of WSN is limited by computing and storage capabilities of sensor nodes. In this paper, we propose an algorithm with parallel and compact techniques based on Whale Optimization Algorithm (PCWOA) to improve DV-Hop performance. The compact technique saves memory consumption by reducing the original population. The parallel techniques enhance the ability to jump out of local optimization and improve the solution accuracy. The proposed algorithm is tested on CEC2013 benchmark functions and compared with some popular algorithms and compact algorithms. Experimental results show that the improved algorithm achieves competitive results over compared algorithms. Finally, simulation research is conducted to verify the localization performance of our proposed algorithm.