Coprime and nested sparse arrays are two widely researched sparse arrays. These arrays, requiring fewer sensors compared to full uniform linear arrays (ULAs), still have a high number of degrees of freedom. The reduced sensor count in sparse arrays contributes to cost and system complexity reduction, and it also lessens the computational burden. This study delves into the computational efficiency aspect of sparse arrays, conducting a comparative analysis of coprime and nested arrays in classifying underwater stationary and moving sources using real sonar data. Leveraging two machine learning-based classification algorithms-support vector machine (SVM) and convolutional neural network (CNN)-the study aims to assess the extent of computational time savings achievable with sparse arrays and the associated tradeoffs in accuracy. Simulation results reveal that both coprime and nested arrays can achieve near 100% classification accuracy for SVM and CNN models when an appropriate number of snapshots is selected for data processing. Additionally, within a suitable range of number of snapshots, computational time can be significantly reduced compared to full ULA, with only a minimal compromise in accuracy (< 2%). The study underscores the effectiveness of machine learning-based classifiers in source identification using sonar data, highlighting their high accuracy. However, it also notes that while a more powerful algorithm enhances operational capacity, it may concurrently escalate the complexity of the algorithm.