论文标题
在N-Queens问题上比较Python,GO和C ++
Comparing Python, Go, and C++ on the N-Queens Problem
论文作者
论文摘要
Python目前是机器学习领域的主要语言,但经常因执行某些任务缓慢而受到批评。在本报告中,我们使用众所周知的$ n $ Queens拼图作为基准测试,以表明一旦使用Numba编译器编译,它就会与C ++竞争,并且在执行速度方面进行竞争,同时仍然允许非常快速的原型制作。顺序和并行程序都是如此。在大多数情况下,在学术环境中出现的情况下,在普通的Python中开发,识别计算瓶颈并使用Numba将其删除是有意义的。
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.