Workload-Specific Performance Evaluation of Python Just-in-Time Compilers

A Comparative Study of Numba and Cython

Authors

  • Sattaru Harshvardhan Reddy School of Engineering, Jawaharlal Nehru University, New Delhi, India 110067
  • Priya Gupta Atal Bihari Vajpayee School of Management and Entrepreneurship, Jawaharlal Nehru University, New Delhi, India 110067 https://orcid.org/0000-0002-4666-4203
  • Deepak Kumar Tata Consultancy Services, Boston, MA, USA 02116
  • Ritu Singhal Indraprastha College for Women, University of Delhi, Delhi, India 110054

Keywords:

Just-In-Time Compilation, Numba, Cython, Python Optimization, Performance Benchmarking

Abstract

The persistent performance gap in dynamic languages like Python has driven the development of numerous compiler solutions. This paper presents a comparative performance analysis of two prominent Python compilers, Numba and Cython, across distinct computational workloads: recursive (Fibonacci series) and arithmetic-intensive (Euclidean distance). Addressing a gap in existing literature, this study provides an evidence-based framework that maps compiler performance directly to workload types. Experiments conducted in a controlled environment measured execution time, speedup ratios, and memory usage. Results demonstrate that Numba achieves a speedup of up to 6.18× over pure Python for arithmetic-intensive tasks, while Cython performs better in deep recursion cases. The study concludes by offering a workload-to-compiler decision framework, which serves as a practical tool and a contribution to the literature on scenario-based compiler recommendations.

References

A. V. Aho, M. S. Lam, R. Sethi, and J. D. Ullman, Compilers: Principles, Techniques, and Tools. Pearson Education, 2nd ed., 2006.

N. Smith, A. Sharma, J. Renner, D. Thien, F. Brown, H. Shacham, et al., "Icarus: Trustworthy just-in-time compilers with symbolic meta-execution," in Proc. ACM SIGOPS 30th Symp. Operating Systems Principles, pp. 473–487, 2024.

S. Tian, J. Huber, J. Tramm, B. Chapman, and J. Doerfert, "Just-in-time compilation and link-time optimization for OpenMP target offloading," in Int. Workshop on OpenMP, (Cham), pp. 145–158, Springer, 2022.

C. Pichler, P. Li, R. Schatz, and H. Mössenböck, "Hybrid execution: Combining ahead-of-time and just-in-time compilation," in Proc. 15th ACM SIGPLAN Int. Workshop on Virtual Machines and Intermediate Languages, pp. 39–49, 2023.

C. Pichler, P. Li, R. Schatz, and H. Mössenböck, "On automating hybrid execution of ahead-of-time and just-in-time compiled code," in Proc. 16th ACM SIGPLAN Int. Workshop on Virtual Machines and Intermediate Languages, pp. 1–11, 2024.

W. Jakob, S. Speierer, N. Roussel, and D. Vicini, "Dr.Jit: A just-in-time compiler for differentiable rendering," ACM Trans. Graph. (TOG), vol. 41, no. 4, pp. 1–19, 2022.

H. Ning, B. Han, Z. Yang, K. Hao, M. Ma, C. Wang, et al., "Exploring simple architecture of just-in-time compilation in databases," in Asia-Pacific Web (APWeb) and Web-Age Inf. Manage. (WAIM) Joint Int. Conf. on Web and Big Data, (Singapore), pp. 504–514, Springer, 2024.

M. Ma, Z. Yang, K. Hao, L. Chen, C. Wang, and Y. Jin, "An empirical analysis of just-in-time compilation in modern databases," in Australasian Database Conf., (Cham), pp. 227–240, Springer, 2023.

F. Latifi, D. Leopoldseder, C. Wimmer, and H. Mössenböck, "CompGen: Generation of fast JIT compilers in a multi-language VM," in Proc. 17th ACM SIGPLAN Int. Symp. on Dynamic Languages, pp. 35–47, 2021.

Q. Zhang, L. Xu, and B. Xu, "Python meets JIT compilers: A simple implementation and a comparative evaluation," Software: Practice and Experience, vol. 54, no. 2, pp. 225–256, 2024.

E. Bauman, J. Duan, K. W. Hamlen, and Z. Lin, "Renewable just-in-time control-flow integrity," in Proc. 26th Int. Symp. on Research in Attacks, Intrusions and Defenses, pp. 580–594, 2023.

S. K. Lam, A. Pitrou, and S. Seibert, "Numba: A LLVM-based Python JIT compiler," in Proc. Second Workshop on the LLVM Compiler Infrastructure in HPC, pp. 1–6, ACM, 2015.

A. N. Ziogas, T. Ben-Nun, T. Schneider, and T. Hoefler, "Productivity, portability, performance: Data-centric Python," in Proc. Int. Conf. for High Performance Computing, Networking, Storage and Analysis (SC '21), 2021.

I. Osborne, P. Elmer, and J. Stark, "Awkward just-in-time (JIT) compilation: A developer's experience," EPJ Web of Conferences, vol. 295, p. 06003, 2024.

P. Gupta, T. ManiKiran, M. Purushotham, L. J. Suriya, R. N. Venkata, and S. Nanda, "Efficient compiler design for a geometric shape domain-specific language: Emphasizing abstraction and optimization techniques," EAI Endorsed Transactions on Scalable Information Systems, vol. 11, no. 4, 2024.

R. Kumar, K. C. Negi, N. K. Sharma, and P. Gupta, "Deep learning-driven compiler enhancements for efficient matrix multiplication," Journal of Computers, Mechanical and Management, vol. 3, no. 2, pp. 08–18, 2024.

Numba Project, "Numba: A high performance Python compiler." https://numba.pydata.org/, 2018.

Numba Project, "Numba documentation." https://numba.pydata.org/, 2019.

B. Hackl, "Cython vs. Numba vs. Mojo: A comparison of different approaches to speed up Python language execution," in Austrian-Slovenian HPC Meeting 2024 (ASHPC24), p. 45, 2024.

P. Grover, "Speed up your algorithms part 2 — Numba." Medium, TDS Archive. https://medium.com/data-science/speed-up-your-algorithms-part-2-numba-293e554c5cc1, 2018.

K. Derlatka, M. Manna, O. Bulenok, D. Zwicker, and S. Arabas, "Numba-MPI v1.0: Enabling MPI communication within Numba/LLVM JIT-compiled Python code," SoftwareX, vol. 28, p. 101897, 2024.

D. Bajaj, U. Bharti, I. Gupta, P. Gupta, and A. Yadav, "GTMicro — microservice identification approach based on deep NLP transformer model for greenfield developments," International Journal of Information Technology, vol. 16, no. 5, pp. 2751–2761, 2024.

J. F. M. Sánchez, Y. E. Gómez, C. E. M. Marín, and R. G. Crespo, "Performance evaluation of WFS service consumption with Python and Cython," in Int. Conf. on Data Science and Network Engineering, (Cham), pp. 278–290, Springer Nature Switzerland, 2025.

S. Behnel, R. Bradshaw, C. Citro, L. Dalcin, D. S. Seljebotn, and K. Smith, "Cython: The best of both worlds," Computing in Science & Engineering, vol. 13, no. 2, pp. 31–39, 2010.

JCMM Volume 5 Issue 2 cover, Article Number 25266: Workload-Specific Performance Evaluation of Python Just-in-Time Compilers

Downloads

Published

2026-04-30

How to Cite

Reddy, S. H., Gupta, P., Kumar, D., & Singhal, R. (2026). Workload-Specific Performance Evaluation of Python Just-in-Time Compilers: A Comparative Study of Numba and Cython. Journal of Computers, Mechanical and Management, 5(2), 120–131. Retrieved from https://jcmm.co.in/index.php/jcmm/article/view/266

Issue

Section

Short Communication

Categories