Comparison of C++ and Python performance based on selected algorithms

Main Article Content

Szymon Bogucki

s95366@pollub.edu.pl

https://orcid.org/0009-0001-3896-9998
Kacper Burda

s95373@pollub.edu.pl

https://orcid.org/0009-0007-9214-9724

Abstract

This article presents a comparative performance analysis of selected algorithms implemented in C++ and Python. The experiments were conducted in a controlled virtual environment (Ubuntu Linux running on Oracle VirtualBox with a single CPU core and 6 GB of RAM). The study covered selected sorting algorithms (Merge Sort, Quick Sort, Heap Sort), searching algorithms (Linear Search and Binary Search), and statistical measures. Tests were performed on datasets ranging from 10 to 1,000,000 elements. Performance evaluation included execution time, CPU utilization, and memory consumption. The results demonstrate a significant performance advantage of C++ in execution time and memory efficiency, particularly for large datasets, while both languages exhibit consistent scalability trends corresponding to their theoretical computational complexity.

Keywords:

performance, C++, Python, algorithms, execution time

Sustainable Development Goal (SDG)

  • Partnerships for the goals

References

Article Details

Bogucki, S., & Burda, K. (2026). Comparison of C++ and Python performance based on selected algorithms. Journal of Computer Sciences Institute, 40, 201-205. https://doi.org/10.35784/jcsi.9584