Comparing Python, Go, and C++ on the N-Queens Problem
Pascal Fua, Krzysztof Lis

TL;DR
This paper demonstrates that Python, when compiled with Numba, can achieve execution speeds comparable to C++ and Go on the N-Queens problem, enabling fast prototyping without sacrificing performance.
Contribution
The study shows that Python with Numba can match C++ and Go performance on the N-Queens benchmark, combining ease of development with efficiency.
Findings
Python with Numba is competitive with C++ and Go in execution speed.
Compiled Python enables fast prototyping for computational tasks.
Parallel Python with Numba performs well on the N-Queens problem.
Abstract
Python currently is the dominant language in the field of Machine Learning but is often criticized for being slow to perform certain tasks. In this report, we use the well-known -queens puzzle as a benchmark to show that once compiled using the Numba compiler it becomes competitive with C++ and Go in terms of execution speed while still allowing for very fast prototyping. This is true of both sequential and parallel programs. In most cases that arise in an academic environment, it therefore makes sense to develop in ordinary Python, identify computational bottlenecks, and use Numba to remove them.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsDistributed and Parallel Computing Systems · Parallel Computing and Optimization Techniques · Computational Physics and Python Applications
