Overview
Chris Myers, Andrew Dolgert (original author)
Cornell Center for Advanced Computing
Revisions: 6/2023, 5/2020, 8/2018, 6/2015, 5/2011 (original)
There are a set of useful strategies for writing code in Python and getting efficient numerical performance necessary for research in computational science. In this topic, we provide a map to the landscape of concepts and techniques that will be explored in further detail in subsequent topics, highlighting the roles of compiled extension modules, faster pure Python code, and multiprocessing techniques.
Objectives
After completing this topic, you should be able to:
- Describe different approaches for accelerating Python code
- Discuss approaches to performance assessment of programs and algorithms
- Understand the structure of the CPython interpreter and the Python/C API
- Discuss how to accelerate Python programs by developing hybrid codes that leverage interpreted and compiled pieces
Prerequisites
As this topic focuses on accelerating Python programs for scientific computing, it implicitly assumes the reader has some prior experience programming in Python, as well as working knowledge of general programming concepts. The target audience is scientists and engineers who are already programming in Python, and are interested in using Python tools and packages to improve the run time performance of the programs they are developing. If additional introductory material about Python is needed, readers can consult Introduction to Python Programming as well as the documentation on the python.org website.