EMPIRICAL PERFORMANCE EVALUATION OF SEQUENTIAL, MULTITHREADING, AND MULTIPROCESSING MODELS FOR CPU-BOUND WORKLOADS IN PYTHON

Authors

  • Muhadi M Ilyas Gultom Universitas Audi Indonesia
  • Demonius Sarumaha Universitas Nahdlatul Ulama Sumatera Utara

Keywords:

Parallel computing, Multiprocessing, Multithreading, Python performance, CPU-bound workload, Speedup analysis

Abstract

The increasing demand for high-performance computing has made parallel processing a critical approach for optimizing computational workloads. Python, despite its popularity in scientific and general-purpose computing, faces architectural limitations due to the Global Interpreter Lock (GIL), which restricts true multithreaded execution in CPU-bound tasks. This study empirically evaluates the performance differences between sequential execution, multithreading, and multiprocessing in Python using controlled benchmarking experiments on an Apple M1 multicore architecture. CPU-bound numerical workloads ranging from 20 million to 120 million iterations were executed under each model, with execution time, speedup, and parallel efficiency measured across multiple repetitions. The results indicate that multithreading provides negligible performance improvement, achieving speedup values of approximately 1.05, confirming the limiting effect of the GIL. In contrast, multiprocessing achieved speedup values between 3.16 and 3.55 using four worker processes, with a maximum parallel efficiency of approximately 89%. These findings demonstrate that process-based parallelism significantly outperforms thread-based parallelism for CPU-intensive workloads in CPython. The study provides empirical validation of theoretical parallel computing models and offers practical guidance for performance optimization in Python-based computational systems.

Keywords : Parallel computing, Multiprocessing, Multithreading, Python performance, CPU-bound workload, Speedup analysis

References

Al-Shafei, M. (2022). Performance evaluation of parallel computing systems: A review of benchmarking methodologies. Journal of Parallel and Distributed Computing, 165, 102–118.

Beazley, D. (2010). Understanding the Python global interpreter lock. ACM Queue, 8(12), 1–16.

Behnel, S., Bradshaw, R., Citro, C., Dalcin, L., Seljebotn, D. S., & Smith, K. (2021). Cython: The best of both worlds. Computing in Science & Engineering, 23(2), 31–39.

Dalcin, L., Paz, R., Kler, P., & Cosimo, A. (2011). Parallel distributed computing using Python. Advances in Water Resources, 34(9), 1124–1139.

Dongarra, J., Beckman, P., Moore, T., et al. (2020). The international exascale software project roadmap update. International Journal of High Performance Computing Applications, 34(4), 423–460.

Jain, R. (1991). The art of computer systems performance analysis: Techniques for experimental design, measurement, simulation, and modeling. John Wiley & Sons.

Li, X., & Kessler, C. (2023). Evaluating multiprocessing strategies in Python for CPU-bound workloads. Journal of Systems Architecture, 137, 102845.

Mittal, S., & Vetter, J. S. (2021). A survey of methods for analyzing and improving GPU energy efficiency. ACM Computing Surveys, 54(4), 1–35.

Nguyen, T., Kim, H., & Lee, S. (2022). Performance analysis of parallel execution models in high-level programming languages. Future Generation Computer Systems, 131, 325–337.

Turner-Trauring, I. (2022). Measuring Python performance: Empirical analysis of multiprocessing and threading. Journal of Open Source Software, 7(70), 4021.

Van Rossum, G., & Drake, F. L. (2009). Python 3 reference manual. CreateSpace.

Williams, S., Waterman, A., & Patterson, D. (2020). Roofline: An insightful visual performance model for multicore architectures (updated perspective). Communications of the ACM, 63(12), 65–76.

Zhang, Y., Cui, H., & Wang, J. (2021). Comparative study of multithreading and multiprocessing performance in Python for CPU-intensive tasks. Journal of Computer Science and Technology, 36(4), 765–778.

Downloads

Published

2025-12-26