## Hands-on: Performance analysis of heat equation solver

It is time for our first hands-on exercise. In the subsequent weeks there will be many more of them. In this exercise you can familiarize yourself with cProfile. Start your …

## Introducing heat equation

Heat (or diffusion) equation is a partial differential equation that describes how the temperature varies in space over time. The numerical solution of the heat equation contains performance aspects that …

## Using cProfile

cProfile is powerful performance analysis tool included in the Python standard library. In this video we walk through the main steps when investigating performance of Python programs with cProfile. As …

## Measuring small code snippets with timeit

Measuring very short execution times has some pitfalls that can be avoided with the help of the timeit Python module. Sometimes one might be interested in measuring the performance of …

## Using applications own timers

By inserting timing routines to a program, the time spent in specific parts of the program can be measured. In order to get a bigger picture of the performance of …

## Where program spends time?

Analyze before you optimize. Some performance aspects can be considered already in early phases of software development, but generally one should first focus on making the program correct. In addition …

## Why are Python programmes slow?

Python is very flexible and dynamic language, but the flexibility comes with a price. Computer programmes are nowadays practically always written in a high-level human readable programming language and then …

## Outline of Python performance issues

We hope that you have now succeeded in setting up the programming environment and downloading the hands-on exercise material. In this video we outline the topics for the rest of …

## Setting up the programming environment

Software In order to carry out the hands-on programming exercises, you need a working Python environment that contains a selection of Python packages for scientific and high-performance computing. The following …

## Prerequisities and structure of the course

In order to succeed in this course, you need to know few things beforehand. First, this course is aimed at people who already know how to program in Python. We …

## Parallel programming with Python

Python has a rich ecosystem also for parallel computing, both standard library and third party packages provide tools for different parallel programming approaches. In this course we focus on the …

## Hands-on: Using C-functions in the heat equation

In this exercise we utilize C-functions in the heat equation solver. Continue with the code located under cython/heat-equation. Reduce the function call overheads by defining proper functions as C-functions. Investigate …

## Hands-on: Adding static typing to heat equation

In this exercise, we create a Cython extension for the heat equation solver and add static typing. The code for this exercise is located under cython/heat-equation. Creating a Cython extension …

## Hands-on: Numexpr

In this exercise we explore how to evaluate expressions efficiently with numexpr. Source code for this exercise is located in numpy/numexpr/ Try different array expressions and investigate how much numexpr …