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

01/08/2020
by   Pascal Fua, et al.
0

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

READ FULL TEXT
research
03/30/2022

A general approach for running Python codes in OpenFOAM using an embedded pybind11 Python interpreter

As the overlap between traditional computational mechanics and machine l...
research
07/03/2018

FluidFFT: common API (C++ and Python) for Fast Fourier Transform HPC libraries

The Python package fluidfft provides a common Python API for performing ...
research
03/15/2023

PyExaFMM: an exercise in designing high-performance software with Python and Numba

Numba is a game-changing compiler for high-performance computing with Py...
research
12/21/2021

PyTracer: Automatically profiling numerical instabilities in Python

Numerical stability is a crucial requirement of reliable scientific comp...
research
06/11/2023

Attention, Compilation, and Solver-based Symbolic Analysis are All You Need

In this paper we present a Java-to-Python (J2P) and Python-to-Java (P2J)...
research
11/26/2022

Approaches to the Parallelization of Merge Sort in Python

The theory of divide-and-conquer parallelization has been well-studied i...
research
07/19/2023

Comparing with Python: Text Analysis in Stata

Text analysis is the process of constructing structured data from unstru...

Please sign up or login with your details

Forgot password? Click here to reset