Comparing Python, Go, and C++ on the N-Queens Problem

Pascal Fua, Krzysztof Lis
1/8/2020
cs.MS

Official code: cvlab-epfl/n-queens-benchmark (3 stars, C++, last commit 2020-01-16).

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 $N$-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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

34C++, PythonDec 30, 20196 years ago

Similar Papers

Cite this paper

@article{fua2020comparing,
  title  = {Comparing Python, Go, and C++ on the N-Queens Problem},
  author = {Pascal Fua and Krzysztof Lis},
  year   = {2020},
  eprint = {2001.02491},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2001.02491}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2001.02491.svg)](https://codeofpaper.com/paper/2001.02491)

Discussion